diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ff5936c..2b364b8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - name: Code Checkout diff --git a/.gitignore b/.gitignore index c66612c..276eed4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ __pycache__/ *.egg-info .env **/.DS_Store +.idea +.venv \ No newline at end of file diff --git a/README.md b/README.md index 89bfbcd..4c9a8f0 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ async def main(): ) # Sign and broadcast a transaction - tx_block = await c.send_tx_block_mode(wallet.sign_and_build(txn)) + tx_block = await c.send_tx_sync_mode(wallet.sign_and_build(txn)) # Converting to JSON for readability print(tx_block.to_json(indent=4)) diff --git a/examples/ledger_example.py b/examples/ledger_example.py index fc02ee8..8eb3006 100644 --- a/examples/ledger_example.py +++ b/examples/ledger_example.py @@ -1,7 +1,7 @@ import asyncio from pyband import Client, Transaction, Wallet -from pyband.messages.oracle.v1 import MsgEditDataSource +from pyband.messages.band.oracle.v1 import MsgEditDataSource from pyband.proto.cosmos.base.v1beta1 import Coin @@ -44,7 +44,7 @@ async def main(): ) # Sign and broadcast a transaction - tx_block = await c.send_tx_block_mode(wallet.sign_and_build(txn)) + tx_block = await c.send_tx_sync_mode(wallet.sign_and_build(txn)) # Convert to JSON for readability print(tx_block.to_json(indent=4)) diff --git a/examples/request_data_example.py b/examples/request_data_example.py index b30fbcc..eedd3d8 100644 --- a/examples/request_data_example.py +++ b/examples/request_data_example.py @@ -2,7 +2,7 @@ import os from pyband import Client, Transaction, Wallet -from pyband.messages.oracle.v1 import MsgRequestData +from pyband.messages.band.oracle.v1 import MsgRequestData from pyband.proto.cosmos.base.v1beta1 import Coin @@ -47,7 +47,7 @@ async def main(): ) # Sign and broadcast a transaction - tx_block = await c.send_tx_block_mode(wallet.sign_and_build(txn)) + tx_block = await c.send_tx_sync_mode(wallet.sign_and_build(txn)) # Converting to JSON for readability print(tx_block.to_json(indent=4)) diff --git a/examples/send_band_example.py b/examples/send_band_example.py index 9ea128e..ff8aa55 100644 --- a/examples/send_band_example.py +++ b/examples/send_band_example.py @@ -41,7 +41,7 @@ async def main(): ) # Sign and broadcast a transaction - tx_block = await c.send_tx_block_mode(wallet.sign_and_build(txn)) + tx_block = await c.send_tx_sync_mode(wallet.sign_and_build(txn)) # Converting to JSON for readability print(tx_block.to_json(indent=4)) diff --git a/poetry.lock b/poetry.lock index 560863b..5e59e31 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry 1.4.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "asn1crypto" version = "1.5.1" description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" -category = "main" optional = false python-versions = "*" files = [ @@ -12,30 +11,46 @@ files = [ {file = "asn1crypto-1.5.1.tar.gz", hash = "sha256:13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c805306ccb9c"}, ] +[[package]] +name = "async-timeout" +version = "4.0.3" +description = "Timeout context manager for asyncio programs" +optional = false +python-versions = ">=3.7" +files = [ + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, +] + +[package.dependencies] +typing-extensions = {version = ">=3.6.5", markers = "python_version < \"3.8\""} + [[package]] name = "attrs" -version = "22.2.0" +version = "24.2.0" description = "Classes Without Boilerplate" -category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "attrs-22.2.0-py3-none-any.whl", hash = "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836"}, - {file = "attrs-22.2.0.tar.gz", hash = "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99"}, + {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"}, + {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"}, ] +[package.dependencies] +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} + [package.extras] -cov = ["attrs[tests]", "coverage-enable-subprocess", "coverage[toml] (>=5.3)"] -dev = ["attrs[docs,tests]"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope.interface"] -tests = ["attrs[tests-no-zope]", "zope.interface"] -tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy (>=0.971,<0.990)", "mypy (>=0.971,<0.990)", "pympler", "pympler", "pytest (>=4.3.0)", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-mypy-plugins", "pytest-xdist[psutil]", "pytest-xdist[psutil]"] +benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "base58" version = "2.0.0" description = "Base58 and Base58Check implementation" -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -47,7 +62,6 @@ files = [ name = "bech32" version = "1.2.0" description = "Reference implementation for Bech32 and segwit addresses." -category = "main" optional = false python-versions = ">=3.5" files = [ @@ -57,28 +71,29 @@ files = [ [[package]] name = "betterproto" -version = "2.0.0b5" +version = "2.0.0b7" description = "A better Protobuf / gRPC generator & library" -category = "main" optional = false -python-versions = ">=3.6.2,<4.0" +python-versions = "<4.0,>=3.7" files = [ - {file = "betterproto-2.0.0b5-py3-none-any.whl", hash = "sha256:d3e6115c7d5136f1d5974e565b7560273f66b43065e74218e472321ee1258f4c"}, - {file = "betterproto-2.0.0b5.tar.gz", hash = "sha256:00a301c70a2db4d3cdd2b261522ae1d34972fb04b655a154d67daaaf4131102e"}, + {file = "betterproto-2.0.0b7-py3-none-any.whl", hash = "sha256:401ab8055e2f814e77b9c88a74d0e1ae3d1e8a969cced6aeb1b59f71ad63fbd2"}, + {file = "betterproto-2.0.0b7.tar.gz", hash = "sha256:1b1458ca5278d519bcd62556a4c236f998a91d503f0f71c67b0b954747052af2"}, ] [package.dependencies] grpclib = ">=0.4.1,<0.5.0" +importlib-metadata = {version = ">=1.6.0", markers = "python_version < \"3.8\""} python-dateutil = ">=2.8,<3.0" +typing-extensions = ">=4.7.1,<5.0.0" [package.extras] -compiler = ["black (>=19.3b0)", "isort (>=5.10.1,<6.0.0)", "jinja2 (>=3.0.3)"] +compiler = ["black (>=23.1.0)", "isort (>=5.11.5,<6.0.0)", "jinja2 (>=3.0.3)"] +rust-codec = ["betterproto-rust-codec (==0.1.1)"] [[package]] name = "bip32" version = "0.0.8" description = "Python implementation of the BIP32 key derivation scheme" -category = "main" optional = false python-versions = "*" files = [ @@ -90,23 +105,61 @@ files = [ base58 = "2.0.0" coincurve = "13.0.0" +[[package]] +name = "bleak" +version = "0.20.2" +description = "Bluetooth Low Energy platform Agnostic Klient" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "bleak-0.20.2-py3-none-any.whl", hash = "sha256:ce3106b7258212d92bb77be06f9301774f51f5bbc9f7cd50976ad794e9514dba"}, + {file = "bleak-0.20.2.tar.gz", hash = "sha256:6c92a47abe34e6dea8ffc5cea9457cbff6e1be966854839dbc25cddb36b79ee4"}, +] + +[package.dependencies] +async-timeout = {version = ">=3.0.0,<5", markers = "python_version < \"3.11\""} +bleak-winrt = {version = ">=1.2.0,<2.0.0", markers = "platform_system == \"Windows\""} +dbus-fast = {version = ">=1.83.0,<2.0.0", markers = "platform_system == \"Linux\""} +pyobjc-core = {version = ">=9.0.1,<10.0.0", markers = "platform_system == \"Darwin\""} +pyobjc-framework-CoreBluetooth = {version = ">=9.0.1,<10.0.0", markers = "platform_system == \"Darwin\""} +pyobjc-framework-libdispatch = {version = ">=9.0.1,<10.0.0", markers = "platform_system == \"Darwin\""} +typing-extensions = {version = ">=4.2.0,<5.0.0", markers = "python_version < \"3.8\""} + +[[package]] +name = "bleak-winrt" +version = "1.2.0" +description = "Python WinRT bindings for Bleak" +optional = false +python-versions = "*" +files = [ + {file = "bleak-winrt-1.2.0.tar.gz", hash = "sha256:0577d070251b9354fc6c45ffac57e39341ebb08ead014b1bdbd43e211d2ce1d6"}, + {file = "bleak_winrt-1.2.0-cp310-cp310-win32.whl", hash = "sha256:a2ae3054d6843ae0cfd3b94c83293a1dfd5804393977dd69bde91cb5099fc47c"}, + {file = "bleak_winrt-1.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:677df51dc825c6657b3ae94f00bd09b8ab88422b40d6a7bdbf7972a63bc44e9a"}, + {file = "bleak_winrt-1.2.0-cp311-cp311-win32.whl", hash = "sha256:9449cdb942f22c9892bc1ada99e2ccce9bea8a8af1493e81fefb6de2cb3a7b80"}, + {file = "bleak_winrt-1.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:98c1b5a6a6c431ac7f76aa4285b752fe14a1c626bd8a1dfa56f66173ff120bee"}, + {file = "bleak_winrt-1.2.0-cp37-cp37m-win32.whl", hash = "sha256:623ac511696e1f58d83cb9c431e32f613395f2199b3db7f125a3d872cab968a4"}, + {file = "bleak_winrt-1.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:13ab06dec55469cf51a2c187be7b630a7a2922e1ea9ac1998135974a7239b1e3"}, + {file = "bleak_winrt-1.2.0-cp38-cp38-win32.whl", hash = "sha256:5a36ff8cd53068c01a795a75d2c13054ddc5f99ce6de62c1a97cd343fc4d0727"}, + {file = "bleak_winrt-1.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:810c00726653a962256b7acd8edf81ab9e4a3c66e936a342ce4aec7dbd3a7263"}, + {file = "bleak_winrt-1.2.0-cp39-cp39-win32.whl", hash = "sha256:dd740047a08925bde54bec357391fcee595d7b8ca0c74c87170a5cbc3f97aa0a"}, + {file = "bleak_winrt-1.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:63130c11acfe75c504a79c01f9919e87f009f5e742bfc7b7a5c2a9c72bf591a7"}, +] + [[package]] name = "certifi" -version = "2022.12.7" +version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2022.12.7-py3-none-any.whl", hash = "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18"}, - {file = "certifi-2022.12.7.tar.gz", hash = "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3"}, + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, ] [[package]] name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = "*" files = [ @@ -181,94 +234,122 @@ pycparser = "*" [[package]] name = "charset-normalizer" -version = "3.1.0" +version = "3.4.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" optional = false python-versions = ">=3.7.0" files = [ - {file = "charset-normalizer-3.1.0.tar.gz", hash = "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-win32.whl", hash = "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448"}, - {file = "charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-win32.whl", hash = "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909"}, - {file = "charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974"}, - {file = "charset_normalizer-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-win32.whl", hash = "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0"}, - {file = "charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-win32.whl", hash = "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1"}, - {file = "charset_normalizer-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b"}, - {file = "charset_normalizer-3.1.0-py3-none-any.whl", hash = "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"}, + {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"}, + {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}, ] [[package]] name = "coincurve" version = "13.0.0" description = "Cross-platform Python CFFI bindings for libsecp256k1" -category = "main" optional = false python-versions = "*" files = [ @@ -309,7 +390,6 @@ cffi = ">=1.3.0" name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -317,16 +397,58 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "dbus-fast" +version = "1.95.2" +description = "A faster version of dbus-next" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "dbus_fast-1.95.2-cp310-cp310-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:69f19fb94ac714b917c51fcc329b51695f085f779841edd6e429170f1f073f47"}, + {file = "dbus_fast-1.95.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c71e84a7ce3b050745dfb2bcd32ade891ecf6f4b06d3baa4dfe30ad09720a0be"}, + {file = "dbus_fast-1.95.2-cp310-cp310-manylinux_2_31_x86_64.whl", hash = "sha256:3ffcd1c999599da7806d7887d5ce1e9f0d814aa35af92daecab542c9b70794c1"}, + {file = "dbus_fast-1.95.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:85739b90e6f983494c3c7187d4daaa50f4f4369aa1e87e876066de97ca1bcd58"}, + {file = "dbus_fast-1.95.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e2c107caefa186919169e07a852edea3d931dfb6112584fa2c6e5653d91c0d2d"}, + {file = "dbus_fast-1.95.2-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:99902ca6c10368492fdf5a28321d86c7e92e50fd742f0163599602c442232d29"}, + {file = "dbus_fast-1.95.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3241252a744b0960e7eb9dcad2892af2bc695b4f47636bab2f17f6012d914ce"}, + {file = "dbus_fast-1.95.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:f52ef5edef41a0ed29645d7c6e1ee89b5e8f5e5c1ba9901699dcec9cfaf8d961"}, + {file = "dbus_fast-1.95.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9706e10a6c24d4c03d28b1631e3882009964d5207a86cae2b42466635d7546be"}, + {file = "dbus_fast-1.95.2-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:3277944b418063ad051e8e49144151962691188b972f1fbca7af39fdef4f8a47"}, + {file = "dbus_fast-1.95.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cab158bcf86c4b2e03c2f3453738a61de83c82cbed11f23331ccc9a9aba6d5b1"}, + {file = "dbus_fast-1.95.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:17d743d13dbde0691adb98f1a6c87f0cf5617a4c9169b4820972dc8869095c6b"}, + {file = "dbus_fast-1.95.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:aefa695088405d313c703790ac503ad0b2ac1e4807393f1f02e410b6984aedd0"}, + {file = "dbus_fast-1.95.2-cp37-cp37m-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:ffd3665a6fbe318aadac998ae117b19214e0782397c86ab47792a120979783a6"}, + {file = "dbus_fast-1.95.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:43093d8e42342841c7ac69e236370c31949c35b659032888dae8b3af1fa35e9e"}, + {file = "dbus_fast-1.95.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4f4b26849254fafb11656fc8c10f8bce67deab683694e0fc7b56edd891d4e118"}, + {file = "dbus_fast-1.95.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:331c4a26e010fd8ad3168b9680f39a7d0765507d3aadcbe5f250da0474877f14"}, + {file = "dbus_fast-1.95.2-cp38-cp38-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:7aee30619c79334980a25a1e94299a751b3f276644ec0a69c76bfe57be184e7a"}, + {file = "dbus_fast-1.95.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c5d344e3fe3c4b16593fad70448c66ca3130c8c692c74a921c15f18650581a7"}, + {file = "dbus_fast-1.95.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9180d4d39d8688b9d8d43f427f0f2883354fa9df18a1f46d14f1762b82249d1f"}, + {file = "dbus_fast-1.95.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e19173e65967581186666a47cd0af06111c7e957fb529198e532b35a47171460"}, + {file = "dbus_fast-1.95.2-cp39-cp39-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:fae11a8ed320013decd2bf6a982f010fff011bf935c4f32141e804ba7963719b"}, + {file = "dbus_fast-1.95.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f653085d9f96ed2e48434ba951cf4bf0229cc273a87b9799e7cf3a9a6612a56"}, + {file = "dbus_fast-1.95.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:05d53e0db08de6b3ba43eb110e01b9e6264e7143849ea9772af45b15575c21b2"}, + {file = "dbus_fast-1.95.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4e73b7dcbac5f418bd4b334ad112e40e8b3bc05c53a3fc451926450ce3bb805e"}, + {file = "dbus_fast-1.95.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:76fb9d11bd6ebe1f832350ec57ada352f096f24b5731e38bcbad86ab9b27190b"}, + {file = "dbus_fast-1.95.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26045c50bbd8c1674814759332333799b073216b2b2cac9e1cfebf757c7f926d"}, + {file = "dbus_fast-1.95.2-pp37-pypy37_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:bd68b5e7d7c6cd10d804d072062100a4893ad0c19bdac03b53b1809c51a4e3c7"}, + {file = "dbus_fast-1.95.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea2692efe0d6d6d58fb427cd0ed53ab44ced0c2ada642b0c15fd139c60a706d6"}, + {file = "dbus_fast-1.95.2-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:33cee333a15241e516ee84aaabdd952dbb1a63f9e986028574451475e97a113f"}, + {file = "dbus_fast-1.95.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6dfd99cf624f769cf838e62d75ceb737b2866b1783a4f11a928cf38e4c906a5f"}, + {file = "dbus_fast-1.95.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:b842e94140e39a196d4d83e02eddcbc461b906871ba02f1c5374055f2d628c47"}, + {file = "dbus_fast-1.95.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08ca9968dd46b854e5c7b00be32cb273edaf17ddc9647811ff63ae3b9dca822d"}, + {file = "dbus_fast-1.95.2.tar.gz", hash = "sha256:3dd64c5cd362ceead6cc02603b6b4cbda58b2cbb6ec816a2f21b1901dfc3cb61"}, +] + [[package]] name = "ecdsa" -version = "0.15" +version = "0.19.0" description = "ECDSA cryptographic signature library (pure python)" -category = "main" optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.6" files = [ - {file = "ecdsa-0.15-py2.py3-none-any.whl", hash = "sha256:867ec9cf6df0b03addc8ef66b56359643cb5d0c1dc329df76ba7ecfe256c8061"}, - {file = "ecdsa-0.15.tar.gz", hash = "sha256:8f12ac317f8a1318efa75757ef0a651abe12e51fc1af8838fb91079445227277"}, + {file = "ecdsa-0.19.0-py2.py3-none-any.whl", hash = "sha256:2cea9b88407fdac7bbeca0833b189e4c9c53f2ef1e1eaa29f6224dbc809b707a"}, + {file = "ecdsa-0.19.0.tar.gz", hash = "sha256:60eaad1199659900dd0af521ed462b793bbdf867432b3948e87416ae4caf6bf8"}, ] [package.dependencies] @@ -340,7 +462,6 @@ gmpy2 = ["gmpy2"] name = "ecpy" version = "1.2.5" description = "Pure Pyhton Elliptic Curve Library" -category = "main" optional = false python-versions = "*" files = [ @@ -350,20 +471,19 @@ files = [ [[package]] name = "future" -version = "0.18.3" +version = "1.0.0" description = "Clean single-source support for Python 3 and 2" -category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ - {file = "future-0.18.3.tar.gz", hash = "sha256:34a17436ed1e96697a86f9de3d15a3b0be01d8bc8de9c1dffd59fb8234ed5307"}, + {file = "future-1.0.0-py3-none-any.whl", hash = "sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216"}, + {file = "future-1.0.0.tar.gz", hash = "sha256:bd2968309307861edae1458a4f8a4f3598c03be43b97521076aebf5d94c07b05"}, ] [[package]] name = "grpclib" version = "0.4.3" description = "Pure-Python gRPC implementation for asyncio" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -381,7 +501,6 @@ protobuf = ["protobuf (>=3.15.0)"] name = "h2" version = "4.1.0" description = "HTTP/2 State-Machine based protocol implementation" -category = "main" optional = false python-versions = ">=3.6.1" files = [ @@ -395,53 +514,90 @@ hyperframe = ">=6.0,<7" [[package]] name = "hidapi" -version = "0.13.1" +version = "0.14.0.post4" description = "A Cython interface to the hidapi from https://github.com/libusb/hidapi" -category = "main" optional = false python-versions = "*" files = [ - {file = "hidapi-0.13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0e245b5177fc59548e4f76400a07a7882fca48a1c650f7c5d902afe519869bd0"}, - {file = "hidapi-0.13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ec97dcb6697659be0878aac14143ba00ab43e86a6bbec2fa6af46f833ab69743"}, - {file = "hidapi-0.13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a48a0c3f1113ac05d389ae4eff00485a253c63dc6e7c7c17ae3026d063ca809a"}, - {file = "hidapi-0.13.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1b2421ace55d1cca96b8d5c09f918e7662b6ac7b7dbb0f624814e831dab5062e"}, - {file = "hidapi-0.13.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:571e3a07bcbdc13c2d2af9bd09839e6f45cfbac8d5e2d28b7e1b844427813162"}, - {file = "hidapi-0.13.1-cp310-cp310-win32.whl", hash = "sha256:6c0a285b3720d1277f318b574d987483d6127b75d7d76decdd6c85c724af8ef7"}, - {file = "hidapi-0.13.1-cp310-cp310-win_amd64.whl", hash = "sha256:da551cdf88122e9d7dbb93557efa69d35fb1b1fea0510a5bd461af331ad92892"}, - {file = "hidapi-0.13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6490021f7d8227fb6277355f143539404c1b9074d77d64febbe0d4a629f0835b"}, - {file = "hidapi-0.13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ebffcf48798bbf2018a86f1465eeabce0da98c2066c99a121db97dd397b798b3"}, - {file = "hidapi-0.13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c6ae8a0b69ca9ae0ad3f948e1174231a9b781a70ff3642e6b110dfec770cf59"}, - {file = "hidapi-0.13.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93b95d8bb6c87f6db03b6eb9faffb2fe977ac788791898651826c1b61a4734c1"}, - {file = "hidapi-0.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aca9899e7fccc6f9e6a909681c5d97cc2ba224683d886c96bcdca3165454d875"}, - {file = "hidapi-0.13.1-cp311-cp311-win32.whl", hash = "sha256:93dfc2739e0d3f773ae148fed9c0f020c13e17d9d512cf73b54a5e60f0b28c68"}, - {file = "hidapi-0.13.1-cp311-cp311-win_amd64.whl", hash = "sha256:68b9281c22e7832e1d140d3eb65718486b61ac24701837c0ff211f2195bedfb8"}, - {file = "hidapi-0.13.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:3c190d4f8be403c8ee543684013e85494ac690da2d636a03a4f7f5b75b41bba5"}, - {file = "hidapi-0.13.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cb651134546cabc1e515b38626732770ec3ab0157b33dc132fc2f4607858658"}, - {file = "hidapi-0.13.1-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ab4dd2e19918beff50638be89b9626191df4514456fd7388611762cdbbd46cc"}, - {file = "hidapi-0.13.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:871808f5b4c8049f758b94375e24bfe87c8a58f91f7c2ca4c482ab003c9af9a7"}, - {file = "hidapi-0.13.1-cp36-cp36m-win32.whl", hash = "sha256:5a51521200fecd677695d7bd12a6efdccf315a16929a65b836fb7ec8596a24f4"}, - {file = "hidapi-0.13.1-cp36-cp36m-win_amd64.whl", hash = "sha256:d1e91ef0cca8185a858491d9e253f585e58888c5350013ab9305caf4b7f563ba"}, - {file = "hidapi-0.13.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8a735ea49c68d6008b4e07b3de5b4c211f875c262dd14d6669a3629bc482a375"}, - {file = "hidapi-0.13.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c8647eeb286d1b46104a297258b4af15e7878b3dbdb9951ba01cf233b2ff513a"}, - {file = "hidapi-0.13.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf6a90f988c3a1b1910f441c29e4c8c21150c6cb0ed5a8be3bea715aed02002d"}, - {file = "hidapi-0.13.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58580360dc69206a54efccc6d234baa6dbfa56394386ff77bdd67228b27c9759"}, - {file = "hidapi-0.13.1-cp37-cp37m-win32.whl", hash = "sha256:1eb1247930ebf45275937db011856880dc6e3c961290dc8783835230312250b6"}, - {file = "hidapi-0.13.1-cp37-cp37m-win_amd64.whl", hash = "sha256:155bce0c0741ee3b4cf93ac53d02526ef16008a1ef3d9071cd67dd4e190c02d8"}, - {file = "hidapi-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2f013d7e107aef90a4c79802f7e44f5280f9fd62d3d43e307dd7d108c95277cd"}, - {file = "hidapi-0.13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:afc7991c12235f3392b5f744b75878429dbf5a3a4a0d51ca18b1e82ebcce7033"}, - {file = "hidapi-0.13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3fcfe6e4a75651baf704001ddf765326ddd64b55b1ba6cd0e2e0851409c27c4"}, - {file = "hidapi-0.13.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64ec0dcce28232354a91d4575a74eab77fcbb4379fa2f4650e9eaadd7561d887"}, - {file = "hidapi-0.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8174e095386a37eb3d8eb08e942f3aa7e6bd703c296dbb6c45cbca40862a7253"}, - {file = "hidapi-0.13.1-cp38-cp38-win32.whl", hash = "sha256:2dcaf4b9df91a10c0e2904f175c0bfed53d51a3fe73d2aba7061ddc360249f86"}, - {file = "hidapi-0.13.1-cp38-cp38-win_amd64.whl", hash = "sha256:f5a16a8a97ac944775369713b35bb47a7cb6b3091458e7cfe4fdec3f7ac9c29e"}, - {file = "hidapi-0.13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0933fef6e1599c38093bec22a3dded359fb0a9ce57ab43db8947eca7308fe0a8"}, - {file = "hidapi-0.13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:20c06a2256696e83c5f2789dcd9a8109009af5f3e75af0082934867fc6de5283"}, - {file = "hidapi-0.13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7b59778cec7ef9f6151778bf65a1b1dd164014238d7d4345c8e376c4a4baac0e"}, - {file = "hidapi-0.13.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:22d5af6f776fffce8078d6d3785dc8c1647688183c1dbda24acf6dd841d76ac3"}, - {file = "hidapi-0.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ed536627429bc299b28188a28d2fe4230b472d737ee9dc5c8376fd66c418674"}, - {file = "hidapi-0.13.1-cp39-cp39-win32.whl", hash = "sha256:63494ccce46bf60491d7e44f1371443a178e21afa287b341288057bfbefbe872"}, - {file = "hidapi-0.13.1-cp39-cp39-win_amd64.whl", hash = "sha256:5696e1479c203e6123db5f6c5effe6fdca3a5da332bd9ba559687056af7b1d3c"}, - {file = "hidapi-0.13.1.tar.gz", hash = "sha256:99b18b28ec414ef9b604ddaed08182e486a400486f31ca56f61d537eed1d17cf"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:01747e681d138ec614321ef6f069e5be3743fa210112e529a34d3e99635e4ac0"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e20d0a1298a4bd342d7d927d928f1a5a29e5fc9dbf9a79e95dc6e2d386d5070"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f0cc21e82e95cb92ef951df8eb8acf5626ac8fa14ab5292abdab1b2349970445"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cb1a2b5da0dcfab6837281342d1785cc373484bd3f27bd06fd2211d88075a7bd"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e11d475429a1bc943ceac4ad8da4be63b240e00da5e10863fc3cbd9a35fdb51c"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2d1c102f754b2085b270e7c29cb8a148ffb05e10325c373d05ac16e2cbce131c"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:7d099c259aadcab2bc3f4fb5a1db579ec886c2cade7533016f62778235150746"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:80fa94668d21b12daf62b034f647d71236470a8ba9a7580e220c47e9c119d932"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-win32.whl", hash = "sha256:21ebd1420db116733536fae227f1cb30ad74bded5090269cdda4facfa73a8867"}, + {file = "hidapi-0.14.0.post4-cp310-cp310-win_amd64.whl", hash = "sha256:a90cfdd29c10425cd4e4cff34adb12d25048561fc946f3562679e45721060a1c"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:74ae8ce339655b2568d74e49c8ef644d34a445dd0a9b4b89d1bf09447b83f5af"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e749b79d9cafc1e9fd9d397d8039377c928ca10a36847fda6407169513802f68"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4169893fe5e368777fce7575a8bdedc1861f13d8fb9fda6b05e8155dde6eb7f1"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d51f8102a2441ce22e080576f8f370d25cb3962161818a89f236b0401840f18"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff021ed0962f2d5d67405ae53c85f6cb3ab8c5af3dff7db8c74672f79f7a39d1"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8ab5ba9fce95e342335ef48640221a46600c1afb66847432fad9823d40a2022"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:56d7538a4e156041bb80f07f47c327f8944e39da469b010041ce44e324d0657c"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a28de4a03fc276614518d8d0997d8152d0edaf8ca9166522316ef1c455e8bc29"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-win32.whl", hash = "sha256:348e68e3a2145a6ec6bebce13ffdf3e5883d8c720752c365027f16e16764def6"}, + {file = "hidapi-0.14.0.post4-cp311-cp311-win_amd64.whl", hash = "sha256:5a5af70dad759b45536a9946d8232ef7d90859845d3554c93bea3e790250df75"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:129d684c2760fafee9014ce63a58d8e2699cdf00cd1a11bb3d706d4715f5ff96"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4f04de00e40db2efc0bcdd047c160274ba7ccd861100fd87c295dd63cb932f2f"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:10a01af155c51a8089fe44e627af2fbd323cfbef7bd55a86837d971aef6088b0"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6eaff1d120c47e1a121eada8dc85eac007d1ed81f3db7fc0da5b6ed17d8edefb"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fedb9c3be6a2376de436d13fcb37a686a9b6bc988585bcc4f5ec61cad925e794"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6270677da02e86b56b81afd5f6f313736b8315b493f3c8a431da285e3a3c5de9"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:da700db947562f8c0ac530215b74b5a27e4c669916ec99cfb5accd14ba08562c"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:707b1ebf5cb051b020e94b039e603351bf2e6620b48fc970228e0dd5d3a91fca"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-win32.whl", hash = "sha256:1487312ad50cf2c08a5ea786167b3229afd6478c4b26974157c3845a84e91231"}, + {file = "hidapi-0.14.0.post4-cp312-cp312-win_amd64.whl", hash = "sha256:8d924bd002a1c17ca51905b3b7b3d580e80ec211a9b8fe4667b73db0ff9e9b54"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6f96ae777e906f0a9d6f75e873313145dfec2b774f558bfcae8ba34f09792460"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:6439fc9686518d0336fac8c5e370093279f53c997540065fce131c97567118d8"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2acadb4f1ae569c4f73ddb461af8733e8f5efcb290c3d0ef1b0671ba793b0ae3"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:884fa003d899113e14908bd3b519c60b48fc3cec0410264dcbdad1c4a8fc2e8d"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a2d466b995f8ff387d68c052d3b74ee981a4ddc4f1a99f32f2dc7022273dc11"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e1f6409854c0a8ed4d1fdbe88d5ee4baf6f19996d1561f76889a132cb083574d"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:bca568a2b7d0d454c7921d70b1cc44f427eb6f95961b6d7b3b9b4532d0de74ef"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9f14ac2737fd6f58d88d2e6bf8ebd03aac7b486c14d3f570b7b1d0013d61b726"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-win32.whl", hash = "sha256:b6b9c4dbf7d7e2635ff129ce6ea82174865c073b75888b8b97dda5a3d9a70493"}, + {file = "hidapi-0.14.0.post4-cp313-cp313-win_amd64.whl", hash = "sha256:87218eeba366c871adcc273407aacbabab781d6a964919712d5583eded5ca50f"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e9af3c9191b7a4dade9152454001622519f4ecfa674b78929b739cfbf4b35d51"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a2c4c3b3d77b759a4a118aa8428da1daf21c01b49915f44d7a3f198bcee4aa7b"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5c14c54cbfd45553cd3e6a23014f8e8f2d12c41cd2783e84c2cb774976d4648f"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04357092b39631d8034b17fd111c5583be2790ad7979ac1983173344d28824e7"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:949f437f517e81bc567429f41fb1e67349046eb43e52d47b2852b5847de452ee"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:f787b76288450f60250895597dabb080894f0ea09ad5df0433412fee42452435"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:41d532d5a358a63db4d7fc1e57ea107150445c90167b39ba6f8fb84597396a48"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-win32.whl", hash = "sha256:3253d198b193065d633cde3f9a59dabeeb1608ece26f0f319a151e8c7775d7ae"}, + {file = "hidapi-0.14.0.post4-cp36-cp36m-win_amd64.whl", hash = "sha256:1bee0f731874d78367a3bf131cb0325578bc9fee0678ed00c4ca3ded45d11c20"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:1807ff8abe3c5dcfa9d8acd71b1ab9f0aeb69cdbb039ddcbb150ed9fbbfd1ba7"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4939faf6382d1c89462e72aa08636bbfe97ecb5464a34b14997e0ca3e1f92906"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac3e6e794a0fd6ee4634bf1beea1c3c91ab6faf8b16f3f672a42541f9c5ea41f"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c45a493dffdfe614a9943a8c7f0df617254f836f1242478f7780fbeafb18a131"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:142374bb39c8973c6d04a2b8b767d64891741d05b09364b32531d9389c3a15bb"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:da777638f5ecf9ef6c979f6c793417f54104d56ac99a48312d6f7e47858c2dd8"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:20a466e4cf2230687d21f55ffffb1a2384a2262fc343e507dd01d1ab981f7573"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-win32.whl", hash = "sha256:ff67139fbaa91eed55e7e916bdc1ccdaf8c909a80a9c480011caa65c4ba82a97"}, + {file = "hidapi-0.14.0.post4-cp37-cp37m-win_amd64.whl", hash = "sha256:1304fdeb694f581c46e7b0d6aebc6adfa66219177f04cacddbec0bd906bd5b7c"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9e4b462fc1f2b160442618448132aebadb71c06b6eb7654eae4385c490100a67"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:68d7e9ba5c48e50f322057b9f88d799c105b5d46c966981aa8e5047b6091541f"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:293b207e737df4577d27661c5135e7c16976f706d3739d7a53a169dde1aaebaa"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a18af6ebd751eea7ddfb093ddf7d0371b05ba0f9a2f8593c7255a34e6bd753ff"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:380a74e743afe7a0241e0efce73ce9697f41d4e2e0a030be5458a44f9119427a"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:6e08884ee9e1e3963701c1cdf22edd17c7ff708728f163efc396964460b3f9b4"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:fbd2835ff193d0261e0de375fea006cb7cb18a30ae1657af48a43e381f6a0995"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6b424ec16068d58d13fb67c7fb728824a3888f8f7fb6ffa3c82d5a54d8b74b7f"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-win32.whl", hash = "sha256:8de94caca7f2616e41466c0ccdf7a96f567914e9e85e89e0b607018777fc0755"}, + {file = "hidapi-0.14.0.post4-cp38-cp38-win_amd64.whl", hash = "sha256:1591e98c0e6db4cc1e34e96295b4ea68eaf37d365d664570441388869e8e3618"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:58a0a0c029886de8b301ce1ee2e7fd6914ae1ca49feb37cc9930c26baa683427"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e70eab52781e58e819730d99e3c825e92c15ec2138b6902ed078c8cd73317ce0"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97192b7756dd854cb2ebc8a1862ffa009cdc203e0399777764462cae3c459d58"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f27c74deda0282a97dd0f006fd79d6d08fdb16c7a3ba156d52fce85e48515b0a"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c8f722864a03c1d243a9538f0872e233d07fc3fe1d945c66c0cb632060d6d009"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f67e60eaa287e0fa35223f2d1f9afda81dd7312c7ba07e08fbdaf1af8a923530"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fa66391be8acb358b381c30f32be5880d591a3358e531d980832d593dfe83d5a"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f3ce310d366335e1ac9416d8e4a27d6eef2ae896fbee0135484d39d001711bea"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-win32.whl", hash = "sha256:60115947607b8b0a719420726a541bad68728ece38b20654e81fef77c9e0bd2f"}, + {file = "hidapi-0.14.0.post4-cp39-cp39-win_amd64.whl", hash = "sha256:21627bb8a0e2023da1dfb7cb7b970c30d6a86e6498721f1123d018b2f64b426f"}, + {file = "hidapi-0.14.0.post4.tar.gz", hash = "sha256:48fce253e526d17b663fbf9989c71c7ef7653ced5f4be65f1437c313fb3dbdf6"}, ] [package.dependencies] @@ -451,7 +607,6 @@ setuptools = ">=19.0" name = "hpack" version = "4.0.0" description = "Pure-Python HPACK header compression" -category = "main" optional = false python-versions = ">=3.6.1" files = [ @@ -463,7 +618,6 @@ files = [ name = "hyperframe" version = "6.0.1" description = "HTTP/2 framing layer for Python" -category = "main" optional = false python-versions = ">=3.6.1" files = [ @@ -473,26 +627,27 @@ files = [ [[package]] name = "idna" -version = "3.4" +version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" optional = false -python-versions = ">=3.5" +python-versions = ">=3.6" files = [ - {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, - {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, ] +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + [[package]] name = "importlib-metadata" -version = "6.1.0" +version = "6.7.0" description = "Read metadata from Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "importlib_metadata-6.1.0-py3-none-any.whl", hash = "sha256:ff80f3b5394912eb1b108fcfd444dc78b7f1f3e16b16188054bd01cb9cb86f09"}, - {file = "importlib_metadata-6.1.0.tar.gz", hash = "sha256:43ce9281e097583d758c2c708c4376371261a02c34682491a8e98352365aad20"}, + {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, + {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, ] [package.dependencies] @@ -502,13 +657,12 @@ zipp = ">=0.5" [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] perf = ["ipython"] -testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] [[package]] name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -518,48 +672,51 @@ files = [ [[package]] name = "ledgerblue" -version = "0.1.45" -description = "Python library to communicate with Ledger Blue/Nano S" -category = "main" +version = "0.1.54" +description = "Python library to communicate with Ledger devices" optional = false -python-versions = "*" +python-versions = ">=3" files = [ - {file = "ledgerblue-0.1.45.tar.gz", hash = "sha256:c0d4c8b0b9dc270274f748e05349f2c827d7238e7c244ab4bd78bd2b5ed21a30"}, + {file = "ledgerblue-0.1.54-py3-none-any.whl", hash = "sha256:df37562570ac4f9f38dc58f33af609c4689b1b7df889081889159d2a21d9c723"}, + {file = "ledgerblue-0.1.54.tar.gz", hash = "sha256:1e7f7d493e919c447a5c8ebeaea0373bdfda0bec216284cecdea07185fdf173e"}, ] [package.dependencies] +bleak = ">=0.20.1" ecpy = ">=0.9.0" future = "*" hidapi = ">=0.7.99" nfcpy = ">=1.0.4" pillow = ">=3.4.0" -protobuf = ">=2.6.1" +protobuf = ">=3.20,<4" +pycryptodome = ">=3.18.0" pycryptodomex = ">=3.6.1" +pyelftools = ">=0.29,<1.0" +python-gnupg = ">=0.5.0" python-u2flib-host = ">=3.0.2" -websocket_client = ">=0.56.0" +websocket-client = ">=0.56.0" [package.extras] +doc = ["sphinx", "sphinx-argparse", "sphinx-rtd-theme"] smartcard = ["python-pyscard (>=1.6.12)"] [[package]] name = "libusb1" -version = "3.0.0" +version = "3.1.0" description = "Pure-python wrapper for libusb-1.0" -category = "main" optional = false python-versions = "*" files = [ - {file = "libusb1-3.0.0-py3-none-any.whl", hash = "sha256:0e652b04cbe85ec8e74f9ee82b49f861fb14b5320ae51399387ad2601ccc0500"}, - {file = "libusb1-3.0.0-py3-none-win32.whl", hash = "sha256:083f75e5d15cb5e2159e64c308c5317284eae926a820d6dce53a9505d18be3b2"}, - {file = "libusb1-3.0.0-py3-none-win_amd64.whl", hash = "sha256:6f6bb010632ada35c661d17a65e135077beef0fbb2434d5ffdb3a4a911fd9490"}, - {file = "libusb1-3.0.0.tar.gz", hash = "sha256:5792a9defee40f15d330a40d9b1800545c32e47ba7fc66b6f28f133c9fcc8538"}, + {file = "libusb1-3.1.0-py3-none-any.whl", hash = "sha256:9d9f16e2c199cab91f48ead585d3f5ec7e8e4be428a25ddfed22abf786fa9b3a"}, + {file = "libusb1-3.1.0-py3-none-win32.whl", hash = "sha256:bc7874302565721f443a27d8182fcc7152e5b560523f12f1377b130f473e4a0c"}, + {file = "libusb1-3.1.0-py3-none-win_amd64.whl", hash = "sha256:77a06ecfb3d002d7c2ce369e28d0138b292fe8db8a3d102b73fda231a716dd35"}, + {file = "libusb1-3.1.0.tar.gz", hash = "sha256:4ee9b0a55f8bd0b3ea7017ae919a6c1f439af742c4a4b04543c5fd7af89b828c"}, ] [[package]] name = "mnemonic" version = "0.19" description = "Implementation of Bitcoin BIP-0039" -category = "main" optional = false python-versions = "*" files = [ @@ -569,93 +726,107 @@ files = [ [[package]] name = "multidict" -version = "6.0.4" +version = "6.0.5" description = "multidict implementation" -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "multidict-6.0.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8"}, - {file = "multidict-6.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eeb6dcc05e911516ae3d1f207d4b0520d07f54484c49dfc294d6e7d63b734171"}, - {file = "multidict-6.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d6d635d5209b82a3492508cf5b365f3446afb65ae7ebd755e70e18f287b0adf7"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c048099e4c9e9d615545e2001d3d8a4380bd403e1a0578734e0d31703d1b0c0b"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ea20853c6dbbb53ed34cb4d080382169b6f4554d394015f1bef35e881bf83547"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16d232d4e5396c2efbbf4f6d4df89bfa905eb0d4dc5b3549d872ab898451f569"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36c63aaa167f6c6b04ef2c85704e93af16c11d20de1d133e39de6a0e84582a93"}, - {file = "multidict-6.0.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64bdf1086b6043bf519869678f5f2757f473dee970d7abf6da91ec00acb9cb98"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:43644e38f42e3af682690876cff722d301ac585c5b9e1eacc013b7a3f7b696a0"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7582a1d1030e15422262de9f58711774e02fa80df0d1578995c76214f6954988"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ddff9c4e225a63a5afab9dd15590432c22e8057e1a9a13d28ed128ecf047bbdc"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ee2a1ece51b9b9e7752e742cfb661d2a29e7bcdba2d27e66e28a99f1890e4fa0"}, - {file = "multidict-6.0.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a2e4369eb3d47d2034032a26c7a80fcb21a2cb22e1173d761a162f11e562caa5"}, - {file = "multidict-6.0.4-cp310-cp310-win32.whl", hash = "sha256:574b7eae1ab267e5f8285f0fe881f17efe4b98c39a40858247720935b893bba8"}, - {file = "multidict-6.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:4dcbb0906e38440fa3e325df2359ac6cb043df8e58c965bb45f4e406ecb162cc"}, - {file = "multidict-6.0.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0dfad7a5a1e39c53ed00d2dd0c2e36aed4650936dc18fd9a1826a5ae1cad6f03"}, - {file = "multidict-6.0.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:64da238a09d6039e3bd39bb3aee9c21a5e34f28bfa5aa22518581f910ff94af3"}, - {file = "multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:ff959bee35038c4624250473988b24f846cbeb2c6639de3602c073f10410ceba"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c5cb09abb18c1ea940fb99360ea0396f34d46566f157122c92dfa069d3e0e982"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:666daae833559deb2d609afa4490b85830ab0dfca811a98b70a205621a6109fe"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11bdf3f5e1518b24530b8241529d2050014c884cf18b6fc69c0c2b30ca248710"}, - {file = "multidict-6.0.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d18748f2d30f94f498e852c67d61261c643b349b9d2a581131725595c45ec6c"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:458f37be2d9e4c95e2d8866a851663cbc76e865b78395090786f6cd9b3bbf4f4"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b1a2eeedcead3a41694130495593a559a668f382eee0727352b9a41e1c45759a"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:7d6ae9d593ef8641544d6263c7fa6408cc90370c8cb2bbb65f8d43e5b0351d9c"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:5979b5632c3e3534e42ca6ff856bb24b2e3071b37861c2c727ce220d80eee9ed"}, - {file = "multidict-6.0.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:dcfe792765fab89c365123c81046ad4103fcabbc4f56d1c1997e6715e8015461"}, - {file = "multidict-6.0.4-cp311-cp311-win32.whl", hash = "sha256:3601a3cece3819534b11d4efc1eb76047488fddd0c85a3948099d5da4d504636"}, - {file = "multidict-6.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:81a4f0b34bd92df3da93315c6a59034df95866014ac08535fc819f043bfd51f0"}, - {file = "multidict-6.0.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:67040058f37a2a51ed8ea8f6b0e6ee5bd78ca67f169ce6122f3e2ec80dfe9b78"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:853888594621e6604c978ce2a0444a1e6e70c8d253ab65ba11657659dcc9100f"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:39ff62e7d0f26c248b15e364517a72932a611a9b75f35b45be078d81bdb86603"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:af048912e045a2dc732847d33821a9d84ba553f5c5f028adbd364dd4765092ac"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1e8b901e607795ec06c9e42530788c45ac21ef3aaa11dbd0c69de543bfb79a9"}, - {file = "multidict-6.0.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62501642008a8b9871ddfccbf83e4222cf8ac0d5aeedf73da36153ef2ec222d2"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:99b76c052e9f1bc0721f7541e5e8c05db3941eb9ebe7b8553c625ef88d6eefde"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:509eac6cf09c794aa27bcacfd4d62c885cce62bef7b2c3e8b2e49d365b5003fe"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:21a12c4eb6ddc9952c415f24eef97e3e55ba3af61f67c7bc388dcdec1404a067"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:5cad9430ab3e2e4fa4a2ef4450f548768400a2ac635841bc2a56a2052cdbeb87"}, - {file = "multidict-6.0.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ab55edc2e84460694295f401215f4a58597f8f7c9466faec545093045476327d"}, - {file = "multidict-6.0.4-cp37-cp37m-win32.whl", hash = "sha256:5a4dcf02b908c3b8b17a45fb0f15b695bf117a67b76b7ad18b73cf8e92608775"}, - {file = "multidict-6.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:6ed5f161328b7df384d71b07317f4d8656434e34591f20552c7bcef27b0ab88e"}, - {file = "multidict-6.0.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5fc1b16f586f049820c5c5b17bb4ee7583092fa0d1c4e28b5239181ff9532e0c"}, - {file = "multidict-6.0.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1502e24330eb681bdaa3eb70d6358e818e8e8f908a22a1851dfd4e15bc2f8161"}, - {file = "multidict-6.0.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b692f419760c0e65d060959df05f2a531945af31fda0c8a3b3195d4efd06de11"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45e1ecb0379bfaab5eef059f50115b54571acfbe422a14f668fc8c27ba410e7e"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ddd3915998d93fbcd2566ddf9cf62cdb35c9e093075f862935573d265cf8f65d"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:59d43b61c59d82f2effb39a93c48b845efe23a3852d201ed2d24ba830d0b4cf2"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc8e1d0c705233c5dd0c5e6460fbad7827d5d36f310a0fadfd45cc3029762258"}, - {file = "multidict-6.0.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6aa0418fcc838522256761b3415822626f866758ee0bc6632c9486b179d0b52"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6748717bb10339c4760c1e63da040f5f29f5ed6e59d76daee30305894069a660"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4d1a3d7ef5e96b1c9e92f973e43aa5e5b96c659c9bc3124acbbd81b0b9c8a951"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4372381634485bec7e46718edc71528024fcdc6f835baefe517b34a33c731d60"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:fc35cb4676846ef752816d5be2193a1e8367b4c1397b74a565a9d0389c433a1d"}, - {file = "multidict-6.0.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:4b9d9e4e2b37daddb5c23ea33a3417901fa7c7b3dee2d855f63ee67a0b21e5b1"}, - {file = "multidict-6.0.4-cp38-cp38-win32.whl", hash = "sha256:e41b7e2b59679edfa309e8db64fdf22399eec4b0b24694e1b2104fb789207779"}, - {file = "multidict-6.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:d6c254ba6e45d8e72739281ebc46ea5eb5f101234f3ce171f0e9f5cc86991480"}, - {file = "multidict-6.0.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:16ab77bbeb596e14212e7bab8429f24c1579234a3a462105cda4a66904998664"}, - {file = "multidict-6.0.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bc779e9e6f7fda81b3f9aa58e3a6091d49ad528b11ed19f6621408806204ad35"}, - {file = "multidict-6.0.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4ceef517eca3e03c1cceb22030a3e39cb399ac86bff4e426d4fc6ae49052cc60"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:281af09f488903fde97923c7744bb001a9b23b039a909460d0f14edc7bf59706"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:52f2dffc8acaba9a2f27174c41c9e57f60b907bb9f096b36b1a1f3be71c6284d"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b41156839806aecb3641f3208c0dafd3ac7775b9c4c422d82ee2a45c34ba81ca"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5e3fc56f88cc98ef8139255cf8cd63eb2c586531e43310ff859d6bb3a6b51f1"}, - {file = "multidict-6.0.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8316a77808c501004802f9beebde51c9f857054a0c871bd6da8280e718444449"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f70b98cd94886b49d91170ef23ec5c0e8ebb6f242d734ed7ed677b24d50c82cf"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bf6774e60d67a9efe02b3616fee22441d86fab4c6d335f9d2051d19d90a40063"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:e69924bfcdda39b722ef4d9aa762b2dd38e4632b3641b1d9a57ca9cd18f2f83a"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:6b181d8c23da913d4ff585afd1155a0e1194c0b50c54fcfe286f70cdaf2b7176"}, - {file = "multidict-6.0.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:52509b5be062d9eafc8170e53026fbc54cf3b32759a23d07fd935fb04fc22d95"}, - {file = "multidict-6.0.4-cp39-cp39-win32.whl", hash = "sha256:27c523fbfbdfd19c6867af7346332b62b586eed663887392cff78d614f9ec313"}, - {file = "multidict-6.0.4-cp39-cp39-win_amd64.whl", hash = "sha256:33029f5734336aa0d4c0384525da0387ef89148dc7191aae00ca5fb23d7aafc2"}, - {file = "multidict-6.0.4.tar.gz", hash = "sha256:3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:411bf8515f3be9813d06004cac41ccf7d1cd46dfe233705933dd163b60e37600"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d147090048129ce3c453f0292e7697d333db95e52616b3793922945804a433c"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:215ed703caf15f578dca76ee6f6b21b7603791ae090fbf1ef9d865571039ade5"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c6390cf87ff6234643428991b7359b5f59cc15155695deb4eda5c777d2b880f"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fd81c4ebdb4f214161be351eb5bcf385426bf023041da2fd9e60681f3cebae"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3cc2ad10255f903656017363cd59436f2111443a76f996584d1077e43ee51182"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6939c95381e003f54cd4c5516740faba40cf5ad3eeff460c3ad1d3e0ea2549bf"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:220dd781e3f7af2c2c1053da9fa96d9cf3072ca58f057f4c5adaaa1cab8fc442"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:766c8f7511df26d9f11cd3a8be623e59cca73d44643abab3f8c8c07620524e4a"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:fe5d7785250541f7f5019ab9cba2c71169dc7d74d0f45253f8313f436458a4ef"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c1c1496e73051918fcd4f58ff2e0f2f3066d1c76a0c6aeffd9b45d53243702cc"}, + {file = "multidict-6.0.5-cp310-cp310-win32.whl", hash = "sha256:7afcdd1fc07befad18ec4523a782cde4e93e0a2bf71239894b8d61ee578c1319"}, + {file = "multidict-6.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:99f60d34c048c5c2fabc766108c103612344c46e35d4ed9ae0673d33c8fb26e8"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f285e862d2f153a70586579c15c44656f888806ed0e5b56b64489afe4a2dbfba"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:53689bb4e102200a4fafa9de9c7c3c212ab40a7ab2c8e474491914d2305f187e"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:612d1156111ae11d14afaf3a0669ebf6c170dbb735e510a7438ffe2369a847fd"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7be7047bd08accdb7487737631d25735c9a04327911de89ff1b26b81745bd4e3"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de170c7b4fe6859beb8926e84f7d7d6c693dfe8e27372ce3b76f01c46e489fcf"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04bde7a7b3de05732a4eb39c94574db1ec99abb56162d6c520ad26f83267de29"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85f67aed7bb647f93e7520633d8f51d3cbc6ab96957c71272b286b2f30dc70ed"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425bf820055005bfc8aa9a0b99ccb52cc2f4070153e34b701acc98d201693733"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d3eb1ceec286eba8220c26f3b0096cf189aea7057b6e7b7a2e60ed36b373b77f"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:7901c05ead4b3fb75113fb1dd33eb1253c6d3ee37ce93305acd9d38e0b5f21a4"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e0e79d91e71b9867c73323a3444724d496c037e578a0e1755ae159ba14f4f3d1"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:29bfeb0dff5cb5fdab2023a7a9947b3b4af63e9c47cae2a10ad58394b517fddc"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e030047e85cbcedbfc073f71836d62dd5dadfbe7531cae27789ff66bc551bd5e"}, + {file = "multidict-6.0.5-cp311-cp311-win32.whl", hash = "sha256:2f4848aa3baa109e6ab81fe2006c77ed4d3cd1e0ac2c1fbddb7b1277c168788c"}, + {file = "multidict-6.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:2faa5ae9376faba05f630d7e5e6be05be22913782b927b19d12b8145968a85ea"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:51d035609b86722963404f711db441cf7134f1889107fb171a970c9701f92e1e"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cbebcd5bcaf1eaf302617c114aa67569dd3f090dd0ce8ba9e35e9985b41ac35b"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ffc42c922dbfddb4a4c3b438eb056828719f07608af27d163191cb3e3aa6cc5"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceb3b7e6a0135e092de86110c5a74e46bda4bd4fbfeeb3a3bcec79c0f861e450"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79660376075cfd4b2c80f295528aa6beb2058fd289f4c9252f986751a4cd0496"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4428b29611e989719874670fd152b6625500ad6c686d464e99f5aaeeaca175a"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d84a5c3a5f7ce6db1f999fb9438f686bc2e09d38143f2d93d8406ed2dd6b9226"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76c0de87358b192de7ea9649beb392f107dcad9ad27276324c24c91774ca5271"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:79a6d2ba910adb2cbafc95dad936f8b9386e77c84c35bc0add315b856d7c3abb"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:92d16a3e275e38293623ebf639c471d3e03bb20b8ebb845237e0d3664914caef"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:fb616be3538599e797a2017cccca78e354c767165e8858ab5116813146041a24"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:14c2976aa9038c2629efa2c148022ed5eb4cb939e15ec7aace7ca932f48f9ba6"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:435a0984199d81ca178b9ae2c26ec3d49692d20ee29bc4c11a2a8d4514c67eda"}, + {file = "multidict-6.0.5-cp312-cp312-win32.whl", hash = "sha256:9fe7b0653ba3d9d65cbe7698cca585bf0f8c83dbbcc710db9c90f478e175f2d5"}, + {file = "multidict-6.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:01265f5e40f5a17f8241d52656ed27192be03bfa8764d88e8220141d1e4b3556"}, + {file = "multidict-6.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:19fe01cea168585ba0f678cad6f58133db2aa14eccaf22f88e4a6dccadfad8b3"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6bf7a982604375a8d49b6cc1b781c1747f243d91b81035a9b43a2126c04766f5"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:107c0cdefe028703fb5dafe640a409cb146d44a6ae201e55b35a4af8e95457dd"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:403c0911cd5d5791605808b942c88a8155c2592e05332d2bf78f18697a5fa15e"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aeaf541ddbad8311a87dd695ed9642401131ea39ad7bc8cf3ef3967fd093b626"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4972624066095e52b569e02b5ca97dbd7a7ddd4294bf4e7247d52635630dd83"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d946b0a9eb8aaa590df1fe082cee553ceab173e6cb5b03239716338629c50c7a"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b55358304d7a73d7bdf5de62494aaf70bd33015831ffd98bc498b433dfe5b10c"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:a3145cb08d8625b2d3fee1b2d596a8766352979c9bffe5d7833e0503d0f0b5e5"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d65f25da8e248202bd47445cec78e0025c0fe7582b23ec69c3b27a640dd7a8e3"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c9bf56195c6bbd293340ea82eafd0071cb3d450c703d2c93afb89f93b8386ccc"}, + {file = "multidict-6.0.5-cp37-cp37m-win32.whl", hash = "sha256:69db76c09796b313331bb7048229e3bee7928eb62bab5e071e9f7fcc4879caee"}, + {file = "multidict-6.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:fce28b3c8a81b6b36dfac9feb1de115bab619b3c13905b419ec71d03a3fc1423"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:76f067f5121dcecf0d63a67f29080b26c43c71a98b10c701b0677e4a065fbd54"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b82cc8ace10ab5bd93235dfaab2021c70637005e1ac787031f4d1da63d493c1d"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5cb241881eefd96b46f89b1a056187ea8e9ba14ab88ba632e68d7a2ecb7aadf7"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8e94e6912639a02ce173341ff62cc1201232ab86b8a8fcc05572741a5dc7d93"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09a892e4a9fb47331da06948690ae38eaa2426de97b4ccbfafbdcbe5c8f37ff8"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55205d03e8a598cfc688c71ca8ea5f66447164efff8869517f175ea632c7cb7b"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37b15024f864916b4951adb95d3a80c9431299080341ab9544ed148091b53f50"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2a1dee728b52b33eebff5072817176c172050d44d67befd681609b4746e1c2e"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:edd08e6f2f1a390bf137080507e44ccc086353c8e98c657e666c017718561b89"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:60d698e8179a42ec85172d12f50b1668254628425a6bd611aba022257cac1386"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3d25f19500588cbc47dc19081d78131c32637c25804df8414463ec908631e453"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4cc0ef8b962ac7a5e62b9e826bd0cd5040e7d401bc45a6835910ed699037a461"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:eca2e9d0cc5a889850e9bbd68e98314ada174ff6ccd1129500103df7a94a7a44"}, + {file = "multidict-6.0.5-cp38-cp38-win32.whl", hash = "sha256:4a6a4f196f08c58c59e0b8ef8ec441d12aee4125a7d4f4fef000ccb22f8d7241"}, + {file = "multidict-6.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:0275e35209c27a3f7951e1ce7aaf93ce0d163b28948444bec61dd7badc6d3f8c"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e7be68734bd8c9a513f2b0cfd508802d6609da068f40dc57d4e3494cefc92929"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1d9ea7a7e779d7a3561aade7d596649fbecfa5c08a7674b11b423783217933f9"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ea1456df2a27c73ce51120fa2f519f1bea2f4a03a917f4a43c8707cf4cbbae1a"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf590b134eb70629e350691ecca88eac3e3b8b3c86992042fb82e3cb1830d5e1"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5c0631926c4f58e9a5ccce555ad7747d9a9f8b10619621f22f9635f069f6233e"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dce1c6912ab9ff5f179eaf6efe7365c1f425ed690b03341911bf4939ef2f3046"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0868d64af83169e4d4152ec612637a543f7a336e4a307b119e98042e852ad9c"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:141b43360bfd3bdd75f15ed811850763555a251e38b2405967f8e25fb43f7d40"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7df704ca8cf4a073334e0427ae2345323613e4df18cc224f647f251e5e75a527"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6214c5a5571802c33f80e6c84713b2c79e024995b9c5897f794b43e714daeec9"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:cd6c8fca38178e12c00418de737aef1261576bd1b6e8c6134d3e729a4e858b38"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e02021f87a5b6932fa6ce916ca004c4d441509d33bbdbeca70d05dff5e9d2479"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ebd8d160f91a764652d3e51ce0d2956b38efe37c9231cd82cfc0bed2e40b581c"}, + {file = "multidict-6.0.5-cp39-cp39-win32.whl", hash = "sha256:04da1bb8c8dbadf2a18a452639771951c662c5ad03aefe4884775454be322c9b"}, + {file = "multidict-6.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:d6f6d4f185481c9669b9447bf9d9cf3b95a0e9df9d169bbc17e363b7d5487755"}, + {file = "multidict-6.0.5-py3-none-any.whl", hash = "sha256:0d63c74e3d7ab26de115c49bffc92cc77ed23395303d496eae515d4204a625e7"}, + {file = "multidict-6.0.5.tar.gz", hash = "sha256:f7e301075edaf50500f0b341543c41194d8df3ae5caf4702f2095f3ca73dd8da"}, ] [[package]] name = "ndeflib" version = "0.3.3" description = "NFC Data Exchange Format decoder and encoder." -category = "main" optional = false python-versions = "*" files = [ @@ -667,7 +838,6 @@ files = [ name = "nfcpy" version = "1.0.4" description = "Python module for Near Field Communication." -category = "main" optional = false python-versions = ">=2.6" files = [ @@ -683,117 +853,103 @@ pyserial = "*" [[package]] name = "packaging" -version = "23.0" +version = "24.0" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "packaging-23.0-py3-none-any.whl", hash = "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2"}, - {file = "packaging-23.0.tar.gz", hash = "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"}, + {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, + {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, ] [[package]] name = "pillow" -version = "9.4.0" +version = "9.5.0" description = "Python Imaging Library (Fork)" -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "Pillow-9.4.0-1-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:1b4b4e9dda4f4e4c4e6896f93e84a8f0bcca3b059de9ddf67dac3c334b1195e1"}, - {file = "Pillow-9.4.0-1-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:fb5c1ad6bad98c57482236a21bf985ab0ef42bd51f7ad4e4538e89a997624e12"}, - {file = "Pillow-9.4.0-1-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:f0caf4a5dcf610d96c3bd32932bfac8aee61c96e60481c2a0ea58da435e25acd"}, - {file = "Pillow-9.4.0-1-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:3f4cc516e0b264c8d4ccd6b6cbc69a07c6d582d8337df79be1e15a5056b258c9"}, - {file = "Pillow-9.4.0-1-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:b8c2f6eb0df979ee99433d8b3f6d193d9590f735cf12274c108bd954e30ca858"}, - {file = "Pillow-9.4.0-1-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:b70756ec9417c34e097f987b4d8c510975216ad26ba6e57ccb53bc758f490dab"}, - {file = "Pillow-9.4.0-1-pp39-pypy39_pp73-macosx_10_10_x86_64.whl", hash = "sha256:43521ce2c4b865d385e78579a082b6ad1166ebed2b1a2293c3be1d68dd7ca3b9"}, - {file = "Pillow-9.4.0-2-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:9d9a62576b68cd90f7075876f4e8444487db5eeea0e4df3ba298ee38a8d067b0"}, - {file = "Pillow-9.4.0-2-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:87708d78a14d56a990fbf4f9cb350b7d89ee8988705e58e39bdf4d82c149210f"}, - {file = "Pillow-9.4.0-2-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:8a2b5874d17e72dfb80d917213abd55d7e1ed2479f38f001f264f7ce7bae757c"}, - {file = "Pillow-9.4.0-2-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:83125753a60cfc8c412de5896d10a0a405e0bd88d0470ad82e0869ddf0cb3848"}, - {file = "Pillow-9.4.0-2-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:9e5f94742033898bfe84c93c831a6f552bb629448d4072dd312306bab3bd96f1"}, - {file = "Pillow-9.4.0-2-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:013016af6b3a12a2f40b704677f8b51f72cb007dac785a9933d5c86a72a7fe33"}, - {file = "Pillow-9.4.0-2-pp39-pypy39_pp73-macosx_10_10_x86_64.whl", hash = "sha256:99d92d148dd03fd19d16175b6d355cc1b01faf80dae93c6c3eb4163709edc0a9"}, - {file = "Pillow-9.4.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:2968c58feca624bb6c8502f9564dd187d0e1389964898f5e9e1fbc8533169157"}, - {file = "Pillow-9.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c5c1362c14aee73f50143d74389b2c158707b4abce2cb055b7ad37ce60738d47"}, - {file = "Pillow-9.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd752c5ff1b4a870b7661234694f24b1d2b9076b8bf337321a814c612665f343"}, - {file = "Pillow-9.4.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9a3049a10261d7f2b6514d35bbb7a4dfc3ece4c4de14ef5876c4b7a23a0e566d"}, - {file = "Pillow-9.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:16a8df99701f9095bea8a6c4b3197da105df6f74e6176c5b410bc2df2fd29a57"}, - {file = "Pillow-9.4.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:94cdff45173b1919350601f82d61365e792895e3c3a3443cf99819e6fbf717a5"}, - {file = "Pillow-9.4.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:ed3e4b4e1e6de75fdc16d3259098de7c6571b1a6cc863b1a49e7d3d53e036070"}, - {file = "Pillow-9.4.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d5b2f8a31bd43e0f18172d8ac82347c8f37ef3e0b414431157718aa234991b28"}, - {file = "Pillow-9.4.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:09b89ddc95c248ee788328528e6a2996e09eaccddeeb82a5356e92645733be35"}, - {file = "Pillow-9.4.0-cp310-cp310-win32.whl", hash = "sha256:f09598b416ba39a8f489c124447b007fe865f786a89dbfa48bb5cf395693132a"}, - {file = "Pillow-9.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:f6e78171be3fb7941f9910ea15b4b14ec27725865a73c15277bc39f5ca4f8391"}, - {file = "Pillow-9.4.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:3fa1284762aacca6dc97474ee9c16f83990b8eeb6697f2ba17140d54b453e133"}, - {file = "Pillow-9.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:eaef5d2de3c7e9b21f1e762f289d17b726c2239a42b11e25446abf82b26ac132"}, - {file = "Pillow-9.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a4dfdae195335abb4e89cc9762b2edc524f3c6e80d647a9a81bf81e17e3fb6f0"}, - {file = "Pillow-9.4.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6abfb51a82e919e3933eb137e17c4ae9c0475a25508ea88993bb59faf82f3b35"}, - {file = "Pillow-9.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:451f10ef963918e65b8869e17d67db5e2f4ab40e716ee6ce7129b0cde2876eab"}, - {file = "Pillow-9.4.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:6663977496d616b618b6cfa43ec86e479ee62b942e1da76a2c3daa1c75933ef4"}, - {file = "Pillow-9.4.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:60e7da3a3ad1812c128750fc1bc14a7ceeb8d29f77e0a2356a8fb2aa8925287d"}, - {file = "Pillow-9.4.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:19005a8e58b7c1796bc0167862b1f54a64d3b44ee5d48152b06bb861458bc0f8"}, - {file = "Pillow-9.4.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f715c32e774a60a337b2bb8ad9839b4abf75b267a0f18806f6f4f5f1688c4b5a"}, - {file = "Pillow-9.4.0-cp311-cp311-win32.whl", hash = "sha256:b222090c455d6d1a64e6b7bb5f4035c4dff479e22455c9eaa1bdd4c75b52c80c"}, - {file = "Pillow-9.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:ba6612b6548220ff5e9df85261bddc811a057b0b465a1226b39bfb8550616aee"}, - {file = "Pillow-9.4.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:5f532a2ad4d174eb73494e7397988e22bf427f91acc8e6ebf5bb10597b49c493"}, - {file = "Pillow-9.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5dd5a9c3091a0f414a963d427f920368e2b6a4c2f7527fdd82cde8ef0bc7a327"}, - {file = "Pillow-9.4.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef21af928e807f10bf4141cad4746eee692a0dd3ff56cfb25fce076ec3cc8abe"}, - {file = "Pillow-9.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:847b114580c5cc9ebaf216dd8c8dbc6b00a3b7ab0131e173d7120e6deade1f57"}, - {file = "Pillow-9.4.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:653d7fb2df65efefbcbf81ef5fe5e5be931f1ee4332c2893ca638c9b11a409c4"}, - {file = "Pillow-9.4.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:46f39cab8bbf4a384ba7cb0bc8bae7b7062b6a11cfac1ca4bc144dea90d4a9f5"}, - {file = "Pillow-9.4.0-cp37-cp37m-win32.whl", hash = "sha256:7ac7594397698f77bce84382929747130765f66406dc2cd8b4ab4da68ade4c6e"}, - {file = "Pillow-9.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:46c259e87199041583658457372a183636ae8cd56dbf3f0755e0f376a7f9d0e6"}, - {file = "Pillow-9.4.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:0e51f608da093e5d9038c592b5b575cadc12fd748af1479b5e858045fff955a9"}, - {file = "Pillow-9.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:765cb54c0b8724a7c12c55146ae4647e0274a839fb6de7bcba841e04298e1011"}, - {file = "Pillow-9.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:519e14e2c49fcf7616d6d2cfc5c70adae95682ae20f0395e9280db85e8d6c4df"}, - {file = "Pillow-9.4.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d197df5489004db87d90b918033edbeee0bd6df3848a204bca3ff0a903bef837"}, - {file = "Pillow-9.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0845adc64fe9886db00f5ab68c4a8cd933ab749a87747555cec1c95acea64b0b"}, - {file = "Pillow-9.4.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:e1339790c083c5a4de48f688b4841f18df839eb3c9584a770cbd818b33e26d5d"}, - {file = "Pillow-9.4.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:a96e6e23f2b79433390273eaf8cc94fec9c6370842e577ab10dabdcc7ea0a66b"}, - {file = "Pillow-9.4.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:7cfc287da09f9d2a7ec146ee4d72d6ea1342e770d975e49a8621bf54eaa8f30f"}, - {file = "Pillow-9.4.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d7081c084ceb58278dd3cf81f836bc818978c0ccc770cbbb202125ddabec6628"}, - {file = "Pillow-9.4.0-cp38-cp38-win32.whl", hash = "sha256:df41112ccce5d47770a0c13651479fbcd8793f34232a2dd9faeccb75eb5d0d0d"}, - {file = "Pillow-9.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:7a21222644ab69ddd9967cfe6f2bb420b460dae4289c9d40ff9a4896e7c35c9a"}, - {file = "Pillow-9.4.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:0f3269304c1a7ce82f1759c12ce731ef9b6e95b6df829dccd9fe42912cc48569"}, - {file = "Pillow-9.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cb362e3b0976dc994857391b776ddaa8c13c28a16f80ac6522c23d5257156bed"}, - {file = "Pillow-9.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a2e0f87144fcbbe54297cae708c5e7f9da21a4646523456b00cc956bd4c65815"}, - {file = "Pillow-9.4.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:28676836c7796805914b76b1837a40f76827ee0d5398f72f7dcc634bae7c6264"}, - {file = "Pillow-9.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0884ba7b515163a1a05440a138adeb722b8a6ae2c2b33aea93ea3118dd3a899e"}, - {file = "Pillow-9.4.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:53dcb50fbdc3fb2c55431a9b30caeb2f7027fcd2aeb501459464f0214200a503"}, - {file = "Pillow-9.4.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:e8c5cf126889a4de385c02a2c3d3aba4b00f70234bfddae82a5eaa3ee6d5e3e6"}, - {file = "Pillow-9.4.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:6c6b1389ed66cdd174d040105123a5a1bc91d0aa7059c7261d20e583b6d8cbd2"}, - {file = "Pillow-9.4.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0dd4c681b82214b36273c18ca7ee87065a50e013112eea7d78c7a1b89a739153"}, - {file = "Pillow-9.4.0-cp39-cp39-win32.whl", hash = "sha256:6d9dfb9959a3b0039ee06c1a1a90dc23bac3b430842dcb97908ddde05870601c"}, - {file = "Pillow-9.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:54614444887e0d3043557d9dbc697dbb16cfb5a35d672b7a0fcc1ed0cf1c600b"}, - {file = "Pillow-9.4.0-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:b9b752ab91e78234941e44abdecc07f1f0d8f51fb62941d32995b8161f68cfe5"}, - {file = "Pillow-9.4.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3b56206244dc8711f7e8b7d6cad4663917cd5b2d950799425076681e8766286"}, - {file = "Pillow-9.4.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aabdab8ec1e7ca7f1434d042bf8b1e92056245fb179790dc97ed040361f16bfd"}, - {file = "Pillow-9.4.0-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:db74f5562c09953b2c5f8ec4b7dfd3f5421f31811e97d1dbc0a7c93d6e3a24df"}, - {file = "Pillow-9.4.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e9d7747847c53a16a729b6ee5e737cf170f7a16611c143d95aa60a109a59c336"}, - {file = "Pillow-9.4.0-pp39-pypy39_pp73-macosx_10_10_x86_64.whl", hash = "sha256:b52ff4f4e002f828ea6483faf4c4e8deea8d743cf801b74910243c58acc6eda3"}, - {file = "Pillow-9.4.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:575d8912dca808edd9acd6f7795199332696d3469665ef26163cd090fa1f8bfa"}, - {file = "Pillow-9.4.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3c4ed2ff6760e98d262e0cc9c9a7f7b8a9f61aa4d47c58835cdaf7b0b8811bb"}, - {file = "Pillow-9.4.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e621b0246192d3b9cb1dc62c78cfa4c6f6d2ddc0ec207d43c0dedecb914f152a"}, - {file = "Pillow-9.4.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8f127e7b028900421cad64f51f75c051b628db17fb00e099eb148761eed598c9"}, - {file = "Pillow-9.4.0.tar.gz", hash = "sha256:a1c2d7780448eb93fbcc3789bf3916aa5720d942e37945f4056680317f1cd23e"}, + {file = "Pillow-9.5.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:ace6ca218308447b9077c14ea4ef381ba0b67ee78d64046b3f19cf4e1139ad16"}, + {file = "Pillow-9.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d3d403753c9d5adc04d4694d35cf0391f0f3d57c8e0030aac09d7678fa8030aa"}, + {file = "Pillow-9.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ba1b81ee69573fe7124881762bb4cd2e4b6ed9dd28c9c60a632902fe8db8b38"}, + {file = "Pillow-9.5.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe7e1c262d3392afcf5071df9afa574544f28eac825284596ac6db56e6d11062"}, + {file = "Pillow-9.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f36397bf3f7d7c6a3abdea815ecf6fd14e7fcd4418ab24bae01008d8d8ca15e"}, + {file = "Pillow-9.5.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:252a03f1bdddce077eff2354c3861bf437c892fb1832f75ce813ee94347aa9b5"}, + {file = "Pillow-9.5.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:85ec677246533e27770b0de5cf0f9d6e4ec0c212a1f89dfc941b64b21226009d"}, + {file = "Pillow-9.5.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b416f03d37d27290cb93597335a2f85ed446731200705b22bb927405320de903"}, + {file = "Pillow-9.5.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1781a624c229cb35a2ac31cc4a77e28cafc8900733a864870c49bfeedacd106a"}, + {file = "Pillow-9.5.0-cp310-cp310-win32.whl", hash = "sha256:8507eda3cd0608a1f94f58c64817e83ec12fa93a9436938b191b80d9e4c0fc44"}, + {file = "Pillow-9.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:d3c6b54e304c60c4181da1c9dadf83e4a54fd266a99c70ba646a9baa626819eb"}, + {file = "Pillow-9.5.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:7ec6f6ce99dab90b52da21cf0dc519e21095e332ff3b399a357c187b1a5eee32"}, + {file = "Pillow-9.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:560737e70cb9c6255d6dcba3de6578a9e2ec4b573659943a5e7e4af13f298f5c"}, + {file = "Pillow-9.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:96e88745a55b88a7c64fa49bceff363a1a27d9a64e04019c2281049444a571e3"}, + {file = "Pillow-9.5.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d9c206c29b46cfd343ea7cdfe1232443072bbb270d6a46f59c259460db76779a"}, + {file = "Pillow-9.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cfcc2c53c06f2ccb8976fb5c71d448bdd0a07d26d8e07e321c103416444c7ad1"}, + {file = "Pillow-9.5.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:a0f9bb6c80e6efcde93ffc51256d5cfb2155ff8f78292f074f60f9e70b942d99"}, + {file = "Pillow-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:8d935f924bbab8f0a9a28404422da8af4904e36d5c33fc6f677e4c4485515625"}, + {file = "Pillow-9.5.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fed1e1cf6a42577953abbe8e6cf2fe2f566daebde7c34724ec8803c4c0cda579"}, + {file = "Pillow-9.5.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c1170d6b195555644f0616fd6ed929dfcf6333b8675fcca044ae5ab110ded296"}, + {file = "Pillow-9.5.0-cp311-cp311-win32.whl", hash = "sha256:54f7102ad31a3de5666827526e248c3530b3a33539dbda27c6843d19d72644ec"}, + {file = "Pillow-9.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:cfa4561277f677ecf651e2b22dc43e8f5368b74a25a8f7d1d4a3a243e573f2d4"}, + {file = "Pillow-9.5.0-cp311-cp311-win_arm64.whl", hash = "sha256:965e4a05ef364e7b973dd17fc765f42233415974d773e82144c9bbaaaea5d089"}, + {file = "Pillow-9.5.0-cp312-cp312-win32.whl", hash = "sha256:22baf0c3cf0c7f26e82d6e1adf118027afb325e703922c8dfc1d5d0156bb2eeb"}, + {file = "Pillow-9.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:432b975c009cf649420615388561c0ce7cc31ce9b2e374db659ee4f7d57a1f8b"}, + {file = "Pillow-9.5.0-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:5d4ebf8e1db4441a55c509c4baa7a0587a0210f7cd25fcfe74dbbce7a4bd1906"}, + {file = "Pillow-9.5.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:375f6e5ee9620a271acb6820b3d1e94ffa8e741c0601db4c0c4d3cb0a9c224bf"}, + {file = "Pillow-9.5.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:99eb6cafb6ba90e436684e08dad8be1637efb71c4f2180ee6b8f940739406e78"}, + {file = "Pillow-9.5.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2dfaaf10b6172697b9bceb9a3bd7b951819d1ca339a5ef294d1f1ac6d7f63270"}, + {file = "Pillow-9.5.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:763782b2e03e45e2c77d7779875f4432e25121ef002a41829d8868700d119392"}, + {file = "Pillow-9.5.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:35f6e77122a0c0762268216315bf239cf52b88865bba522999dc38f1c52b9b47"}, + {file = "Pillow-9.5.0-cp37-cp37m-win32.whl", hash = "sha256:aca1c196f407ec7cf04dcbb15d19a43c507a81f7ffc45b690899d6a76ac9fda7"}, + {file = "Pillow-9.5.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322724c0032af6692456cd6ed554bb85f8149214d97398bb80613b04e33769f6"}, + {file = "Pillow-9.5.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:a0aa9417994d91301056f3d0038af1199eb7adc86e646a36b9e050b06f526597"}, + {file = "Pillow-9.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f8286396b351785801a976b1e85ea88e937712ee2c3ac653710a4a57a8da5d9c"}, + {file = "Pillow-9.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c830a02caeb789633863b466b9de10c015bded434deb3ec87c768e53752ad22a"}, + {file = "Pillow-9.5.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fbd359831c1657d69bb81f0db962905ee05e5e9451913b18b831febfe0519082"}, + {file = "Pillow-9.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8fc330c3370a81bbf3f88557097d1ea26cd8b019d6433aa59f71195f5ddebbf"}, + {file = "Pillow-9.5.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:7002d0797a3e4193c7cdee3198d7c14f92c0836d6b4a3f3046a64bd1ce8df2bf"}, + {file = "Pillow-9.5.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:229e2c79c00e85989a34b5981a2b67aa079fd08c903f0aaead522a1d68d79e51"}, + {file = "Pillow-9.5.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9adf58f5d64e474bed00d69bcd86ec4bcaa4123bfa70a65ce72e424bfb88ed96"}, + {file = "Pillow-9.5.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:662da1f3f89a302cc22faa9f14a262c2e3951f9dbc9617609a47521c69dd9f8f"}, + {file = "Pillow-9.5.0-cp38-cp38-win32.whl", hash = "sha256:6608ff3bf781eee0cd14d0901a2b9cc3d3834516532e3bd673a0a204dc8615fc"}, + {file = "Pillow-9.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:e49eb4e95ff6fd7c0c402508894b1ef0e01b99a44320ba7d8ecbabefddcc5569"}, + {file = "Pillow-9.5.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:482877592e927fd263028c105b36272398e3e1be3269efda09f6ba21fd83ec66"}, + {file = "Pillow-9.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3ded42b9ad70e5f1754fb7c2e2d6465a9c842e41d178f262e08b8c85ed8a1d8e"}, + {file = "Pillow-9.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c446d2245ba29820d405315083d55299a796695d747efceb5717a8b450324115"}, + {file = "Pillow-9.5.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8aca1152d93dcc27dc55395604dcfc55bed5f25ef4c98716a928bacba90d33a3"}, + {file = "Pillow-9.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:608488bdcbdb4ba7837461442b90ea6f3079397ddc968c31265c1e056964f1ef"}, + {file = "Pillow-9.5.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:60037a8db8750e474af7ffc9faa9b5859e6c6d0a50e55c45576bf28be7419705"}, + {file = "Pillow-9.5.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:07999f5834bdc404c442146942a2ecadd1cb6292f5229f4ed3b31e0a108746b1"}, + {file = "Pillow-9.5.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a127ae76092974abfbfa38ca2d12cbeddcdeac0fb71f9627cc1135bedaf9d51a"}, + {file = "Pillow-9.5.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:489f8389261e5ed43ac8ff7b453162af39c3e8abd730af8363587ba64bb2e865"}, + {file = "Pillow-9.5.0-cp39-cp39-win32.whl", hash = "sha256:9b1af95c3a967bf1da94f253e56b6286b50af23392a886720f563c547e48e964"}, + {file = "Pillow-9.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:77165c4a5e7d5a284f10a6efaa39a0ae8ba839da344f20b111d62cc932fa4e5d"}, + {file = "Pillow-9.5.0-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:833b86a98e0ede388fa29363159c9b1a294b0905b5128baf01db683672f230f5"}, + {file = "Pillow-9.5.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aaf305d6d40bd9632198c766fb64f0c1a83ca5b667f16c1e79e1661ab5060140"}, + {file = "Pillow-9.5.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0852ddb76d85f127c135b6dd1f0bb88dbb9ee990d2cd9aa9e28526c93e794fba"}, + {file = "Pillow-9.5.0-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:91ec6fe47b5eb5a9968c79ad9ed78c342b1f97a091677ba0e012701add857829"}, + {file = "Pillow-9.5.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:cb841572862f629b99725ebaec3287fc6d275be9b14443ea746c1dd325053cbd"}, + {file = "Pillow-9.5.0-pp39-pypy39_pp73-macosx_10_10_x86_64.whl", hash = "sha256:c380b27d041209b849ed246b111b7c166ba36d7933ec6e41175fd15ab9eb1572"}, + {file = "Pillow-9.5.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7c9af5a3b406a50e313467e3565fc99929717f780164fe6fbb7704edba0cebbe"}, + {file = "Pillow-9.5.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5671583eab84af046a397d6d0ba25343c00cd50bce03787948e0fff01d4fd9b1"}, + {file = "Pillow-9.5.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:84a6f19ce086c1bf894644b43cd129702f781ba5751ca8572f08aa40ef0ab7b7"}, + {file = "Pillow-9.5.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1e7723bd90ef94eda669a3c2c19d549874dd5badaeefabefd26053304abe5799"}, + {file = "Pillow-9.5.0.tar.gz", hash = "sha256:bf548479d336726d7a0eceb6e767e179fbde37833ae42794602631a070d630f1"}, ] [package.extras] -docs = ["furo", "olefile", "sphinx (>=2.4)", "sphinx-copybutton", "sphinx-inline-tabs", "sphinx-issues (>=3.0.1)", "sphinx-removed-in", "sphinxext-opengraph"] +docs = ["furo", "olefile", "sphinx (>=2.4)", "sphinx-copybutton", "sphinx-inline-tabs", "sphinx-removed-in", "sphinxext-opengraph"] tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout"] [[package]] name = "pluggy" -version = "1.0.0" +version = "1.2.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, - {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, + {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, + {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, ] [package.dependencies] @@ -805,32 +961,39 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "protobuf" -version = "4.22.1" -description = "" -category = "main" +version = "3.20.3" +description = "Protocol Buffers" optional = false python-versions = ">=3.7" files = [ - {file = "protobuf-4.22.1-cp310-abi3-win32.whl", hash = "sha256:85aa9acc5a777adc0c21b449dafbc40d9a0b6413ff3a4f77ef9df194be7f975b"}, - {file = "protobuf-4.22.1-cp310-abi3-win_amd64.whl", hash = "sha256:8bc971d76c03f1dd49f18115b002254f2ddb2d4b143c583bb860b796bb0d399e"}, - {file = "protobuf-4.22.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:5917412347e1da08ce2939eb5cd60650dfb1a9ab4606a415b9278a1041fb4d19"}, - {file = "protobuf-4.22.1-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:9e12e2810e7d297dbce3c129ae5e912ffd94240b050d33f9ecf023f35563b14f"}, - {file = "protobuf-4.22.1-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:953fc7904ef46900262a26374b28c2864610b60cdc8b272f864e22143f8373c4"}, - {file = "protobuf-4.22.1-cp37-cp37m-win32.whl", hash = "sha256:6e100f7bc787cd0a0ae58dbf0ab8bbf1ee7953f862b89148b6cf5436d5e9eaa1"}, - {file = "protobuf-4.22.1-cp37-cp37m-win_amd64.whl", hash = "sha256:87a6393fa634f294bf24d1cfe9fdd6bb605cbc247af81b9b10c4c0f12dfce4b3"}, - {file = "protobuf-4.22.1-cp38-cp38-win32.whl", hash = "sha256:e3fb58076bdb550e75db06ace2a8b3879d4c4f7ec9dd86e4254656118f4a78d7"}, - {file = "protobuf-4.22.1-cp38-cp38-win_amd64.whl", hash = "sha256:651113695bc2e5678b799ee5d906b5d3613f4ccfa61b12252cfceb6404558af0"}, - {file = "protobuf-4.22.1-cp39-cp39-win32.whl", hash = "sha256:67b7d19da0fda2733702c2299fd1ef6cb4b3d99f09263eacaf1aa151d9d05f02"}, - {file = "protobuf-4.22.1-cp39-cp39-win_amd64.whl", hash = "sha256:b8700792f88e59ccecfa246fa48f689d6eee6900eddd486cdae908ff706c482b"}, - {file = "protobuf-4.22.1-py3-none-any.whl", hash = "sha256:3e19dcf4adbf608924d3486ece469dd4f4f2cf7d2649900f0efcd1a84e8fd3ba"}, - {file = "protobuf-4.22.1.tar.gz", hash = "sha256:dce7a55d501c31ecf688adb2f6c3f763cf11bc0be815d1946a84d74772ab07a7"}, + {file = "protobuf-3.20.3-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99"}, + {file = "protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e"}, + {file = "protobuf-3.20.3-cp310-cp310-win32.whl", hash = "sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c"}, + {file = "protobuf-3.20.3-cp310-cp310-win_amd64.whl", hash = "sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7"}, + {file = "protobuf-3.20.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469"}, + {file = "protobuf-3.20.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4"}, + {file = "protobuf-3.20.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4"}, + {file = "protobuf-3.20.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454"}, + {file = "protobuf-3.20.3-cp37-cp37m-win32.whl", hash = "sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905"}, + {file = "protobuf-3.20.3-cp37-cp37m-win_amd64.whl", hash = "sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c"}, + {file = "protobuf-3.20.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7"}, + {file = "protobuf-3.20.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee"}, + {file = "protobuf-3.20.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050"}, + {file = "protobuf-3.20.3-cp38-cp38-win32.whl", hash = "sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86"}, + {file = "protobuf-3.20.3-cp38-cp38-win_amd64.whl", hash = "sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9"}, + {file = "protobuf-3.20.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b"}, + {file = "protobuf-3.20.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b"}, + {file = "protobuf-3.20.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402"}, + {file = "protobuf-3.20.3-cp39-cp39-win32.whl", hash = "sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480"}, + {file = "protobuf-3.20.3-cp39-cp39-win_amd64.whl", hash = "sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7"}, + {file = "protobuf-3.20.3-py2.py3-none-any.whl", hash = "sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db"}, + {file = "protobuf-3.20.3.tar.gz", hash = "sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2"}, ] [[package]] name = "py" version = "1.11.0" description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -842,7 +1005,6 @@ files = [ name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -850,65 +1012,187 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pycryptodome" +version = "3.21.0" +description = "Cryptographic library for Python" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "pycryptodome-3.21.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:dad9bf36eda068e89059d1f07408e397856be9511d7113ea4b586642a429a4fd"}, + {file = "pycryptodome-3.21.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:a1752eca64c60852f38bb29e2c86fca30d7672c024128ef5d70cc15868fa10f4"}, + {file = "pycryptodome-3.21.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:3ba4cc304eac4d4d458f508d4955a88ba25026890e8abff9b60404f76a62c55e"}, + {file = "pycryptodome-3.21.0-cp27-cp27m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7cb087b8612c8a1a14cf37dd754685be9a8d9869bed2ffaaceb04850a8aeef7e"}, + {file = "pycryptodome-3.21.0-cp27-cp27m-musllinux_1_1_aarch64.whl", hash = "sha256:26412b21df30b2861424a6c6d5b1d8ca8107612a4cfa4d0183e71c5d200fb34a"}, + {file = "pycryptodome-3.21.0-cp27-cp27m-win32.whl", hash = "sha256:cc2269ab4bce40b027b49663d61d816903a4bd90ad88cb99ed561aadb3888dd3"}, + {file = "pycryptodome-3.21.0-cp27-cp27m-win_amd64.whl", hash = "sha256:0fa0a05a6a697ccbf2a12cec3d6d2650b50881899b845fac6e87416f8cb7e87d"}, + {file = "pycryptodome-3.21.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:6cce52e196a5f1d6797ff7946cdff2038d3b5f0aba4a43cb6bf46b575fd1b5bb"}, + {file = "pycryptodome-3.21.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:a915597ffccabe902e7090e199a7bf7a381c5506a747d5e9d27ba55197a2c568"}, + {file = "pycryptodome-3.21.0-cp27-cp27mu-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a4e74c522d630766b03a836c15bff77cb657c5fdf098abf8b1ada2aebc7d0819"}, + {file = "pycryptodome-3.21.0-cp27-cp27mu-musllinux_1_1_aarch64.whl", hash = "sha256:a3804675283f4764a02db05f5191eb8fec2bb6ca34d466167fc78a5f05bbe6b3"}, + {file = "pycryptodome-3.21.0-cp36-abi3-macosx_10_9_universal2.whl", hash = "sha256:2480ec2c72438430da9f601ebc12c518c093c13111a5c1644c82cdfc2e50b1e4"}, + {file = "pycryptodome-3.21.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:de18954104667f565e2fbb4783b56667f30fb49c4d79b346f52a29cb198d5b6b"}, + {file = "pycryptodome-3.21.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de4b7263a33947ff440412339cb72b28a5a4c769b5c1ca19e33dd6cd1dcec6e"}, + {file = "pycryptodome-3.21.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0714206d467fc911042d01ea3a1847c847bc10884cf674c82e12915cfe1649f8"}, + {file = "pycryptodome-3.21.0-cp36-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7d85c1b613121ed3dbaa5a97369b3b757909531a959d229406a75b912dd51dd1"}, + {file = "pycryptodome-3.21.0-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:8898a66425a57bcf15e25fc19c12490b87bd939800f39a03ea2de2aea5e3611a"}, + {file = "pycryptodome-3.21.0-cp36-abi3-musllinux_1_2_i686.whl", hash = "sha256:932c905b71a56474bff8a9c014030bc3c882cee696b448af920399f730a650c2"}, + {file = "pycryptodome-3.21.0-cp36-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:18caa8cfbc676eaaf28613637a89980ad2fd96e00c564135bf90bc3f0b34dd93"}, + {file = "pycryptodome-3.21.0-cp36-abi3-win32.whl", hash = "sha256:280b67d20e33bb63171d55b1067f61fbd932e0b1ad976b3a184303a3dad22764"}, + {file = "pycryptodome-3.21.0-cp36-abi3-win_amd64.whl", hash = "sha256:b7aa25fc0baa5b1d95b7633af4f5f1838467f1815442b22487426f94e0d66c53"}, + {file = "pycryptodome-3.21.0-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:2cb635b67011bc147c257e61ce864879ffe6d03342dc74b6045059dfbdedafca"}, + {file = "pycryptodome-3.21.0-pp27-pypy_73-win32.whl", hash = "sha256:4c26a2f0dc15f81ea3afa3b0c87b87e501f235d332b7f27e2225ecb80c0b1cdd"}, + {file = "pycryptodome-3.21.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:d5ebe0763c982f069d3877832254f64974139f4f9655058452603ff559c482e8"}, + {file = "pycryptodome-3.21.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ee86cbde706be13f2dec5a42b52b1c1d1cbb90c8e405c68d0755134735c8dc6"}, + {file = "pycryptodome-3.21.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0fd54003ec3ce4e0f16c484a10bc5d8b9bd77fa662a12b85779a2d2d85d67ee0"}, + {file = "pycryptodome-3.21.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5dfafca172933506773482b0e18f0cd766fd3920bd03ec85a283df90d8a17bc6"}, + {file = "pycryptodome-3.21.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:590ef0898a4b0a15485b05210b4a1c9de8806d3ad3d47f74ab1dc07c67a6827f"}, + {file = "pycryptodome-3.21.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f35e442630bc4bc2e1878482d6f59ea22e280d7121d7adeaedba58c23ab6386b"}, + {file = "pycryptodome-3.21.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff99f952db3db2fbe98a0b355175f93ec334ba3d01bbde25ad3a5a33abc02b58"}, + {file = "pycryptodome-3.21.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8acd7d34af70ee63f9a849f957558e49a98f8f1634f86a59d2be62bb8e93f71c"}, + {file = "pycryptodome-3.21.0.tar.gz", hash = "sha256:f7787e0d469bdae763b876174cf2e6c0f7be79808af26b1da96f1a64bcf47297"}, +] + [[package]] name = "pycryptodomex" -version = "3.17" +version = "3.21.0" description = "Cryptographic library for Python" -category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "pycryptodomex-3.17-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:12056c38e49d972f9c553a3d598425f8a1c1d35b2e4330f89d5ff1ffb70de041"}, - {file = "pycryptodomex-3.17-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:ab33c2d9f275e05e235dbca1063753b5346af4a5cac34a51fa0da0d4edfb21d7"}, - {file = "pycryptodomex-3.17-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:caa937ff29d07a665dfcfd7a84f0d4207b2ebf483362fa9054041d67fdfacc20"}, - {file = "pycryptodomex-3.17-cp27-cp27m-manylinux2014_aarch64.whl", hash = "sha256:db23d7341e21b273d2440ec6faf6c8b1ca95c8894da612e165be0b89a8688340"}, - {file = "pycryptodomex-3.17-cp27-cp27m-musllinux_1_1_aarch64.whl", hash = "sha256:f854c8476512cebe6a8681cc4789e4fcff6019c17baa0fd72b459155dc605ab4"}, - {file = "pycryptodomex-3.17-cp27-cp27m-win32.whl", hash = "sha256:a57e3257bacd719769110f1f70dd901c5b6955e9596ad403af11a3e6e7e3311c"}, - {file = "pycryptodomex-3.17-cp27-cp27m-win_amd64.whl", hash = "sha256:d38ab9e53b1c09608ba2d9b8b888f1e75d6f66e2787e437adb1fecbffec6b112"}, - {file = "pycryptodomex-3.17-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:3c2516b42437ae6c7a29ef3ddc73c8d4714e7b6df995b76be4695bbe4b3b5cd2"}, - {file = "pycryptodomex-3.17-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:5c23482860302d0d9883404eaaa54b0615eefa5274f70529703e2c43cc571827"}, - {file = "pycryptodomex-3.17-cp27-cp27mu-manylinux2014_aarch64.whl", hash = "sha256:7a8dc3ee7a99aae202a4db52de5a08aa4d01831eb403c4d21da04ec2f79810db"}, - {file = "pycryptodomex-3.17-cp27-cp27mu-musllinux_1_1_aarch64.whl", hash = "sha256:7cc28dd33f1f3662d6da28ead4f9891035f63f49d30267d3b41194c8778997c8"}, - {file = "pycryptodomex-3.17-cp35-abi3-macosx_10_9_universal2.whl", hash = "sha256:2d4d395f109faba34067a08de36304e846c791808524614c731431ee048fe70a"}, - {file = "pycryptodomex-3.17-cp35-abi3-macosx_10_9_x86_64.whl", hash = "sha256:55eed98b4150a744920597c81b3965b632038781bab8a08a12ea1d004213c600"}, - {file = "pycryptodomex-3.17-cp35-abi3-manylinux2014_aarch64.whl", hash = "sha256:7fa0b52df90343fafe319257b31d909be1d2e8852277fb0376ba89d26d2921db"}, - {file = "pycryptodomex-3.17-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78f0ddd4adc64baa39b416f3637aaf99f45acb0bcdc16706f0cc7ebfc6f10109"}, - {file = "pycryptodomex-3.17-cp35-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a4fa037078e92c7cc49f6789a8bac3de06856740bb2038d05f2d9a2e4b165d59"}, - {file = "pycryptodomex-3.17-cp35-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:88b0d5bb87eaf2a31e8a759302b89cf30c97f2f8ca7d83b8c9208abe8acb447a"}, - {file = "pycryptodomex-3.17-cp35-abi3-musllinux_1_1_i686.whl", hash = "sha256:6feedf4b0e36b395329b4186a805f60f900129cdf0170e120ecabbfcb763995d"}, - {file = "pycryptodomex-3.17-cp35-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:7a6651a07f67c28b6e978d63aa3a3fccea0feefed9a8453af3f7421a758461b7"}, - {file = "pycryptodomex-3.17-cp35-abi3-win32.whl", hash = "sha256:32e764322e902bbfac49ca1446604d2839381bbbdd5a57920c9daaf2e0b778df"}, - {file = "pycryptodomex-3.17-cp35-abi3-win_amd64.whl", hash = "sha256:4b51e826f0a04d832eda0790bbd0665d9bfe73e5a4d8ea93b6a9b38beeebe935"}, - {file = "pycryptodomex-3.17-pp27-pypy_73-macosx_10_9_x86_64.whl", hash = "sha256:d4cf0128da167562c49b0e034f09e9cedd733997354f2314837c2fa461c87bb1"}, - {file = "pycryptodomex-3.17-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:c92537b596bd5bffb82f8964cabb9fef1bca8a28a9e0a69ffd3ec92a4a7ad41b"}, - {file = "pycryptodomex-3.17-pp27-pypy_73-win32.whl", hash = "sha256:599bb4ae4bbd614ca05f49bd4e672b7a250b80b13ae1238f05fd0f09d87ed80a"}, - {file = "pycryptodomex-3.17-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4c4674f4b040321055c596aac926d12f7f6859dfe98cd12f4d9453b43ab6adc8"}, - {file = "pycryptodomex-3.17-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67a3648025e4ddb72d43addab764336ba2e670c8377dba5dd752e42285440d31"}, - {file = "pycryptodomex-3.17-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40e8a11f578bd0851b02719c862d55d3ee18d906c8b68a9c09f8c564d6bb5b92"}, - {file = "pycryptodomex-3.17-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:23d83b610bd97704f0cd3acc48d99b76a15c8c1540d8665c94d514a49905bad7"}, - {file = "pycryptodomex-3.17-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:fd29d35ac80755e5c0a99d96b44fb9abbd7e871849581ea6a4cb826d24267537"}, - {file = "pycryptodomex-3.17-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64b876d57cb894b31056ad8dd6a6ae1099b117ae07a3d39707221133490e5715"}, - {file = "pycryptodomex-3.17-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee8bf4fdcad7d66beb744957db8717afc12d176e3fd9c5d106835133881a049b"}, - {file = "pycryptodomex-3.17-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c84689c73358dfc23f9fdcff2cb9e7856e65e2ce3b5ed8ff630d4c9bdeb1867b"}, - {file = "pycryptodomex-3.17.tar.gz", hash = "sha256:0af93aad8d62e810247beedef0261c148790c52f3cd33643791cc6396dd217c1"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:dbeb84a399373df84a69e0919c1d733b89e049752426041deeb30d68e9867822"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:a192fb46c95489beba9c3f002ed7d93979423d1b2a53eab8771dbb1339eb3ddd"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:1233443f19d278c72c4daae749872a4af3787a813e05c3561c73ab0c153c7b0f"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbb07f88e277162b8bfca7134b34f18b400d84eac7375ce73117f865e3c80d4c"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-musllinux_1_1_aarch64.whl", hash = "sha256:e859e53d983b7fe18cb8f1b0e29d991a5c93be2c8dd25db7db1fe3bd3617f6f9"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-win32.whl", hash = "sha256:ef046b2e6c425647971b51424f0f88d8a2e0a2a63d3531817968c42078895c00"}, + {file = "pycryptodomex-3.21.0-cp27-cp27m-win_amd64.whl", hash = "sha256:da76ebf6650323eae7236b54b1b1f0e57c16483be6e3c1ebf901d4ada47563b6"}, + {file = "pycryptodomex-3.21.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:c07e64867a54f7e93186a55bec08a18b7302e7bee1b02fd84c6089ec215e723a"}, + {file = "pycryptodomex-3.21.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:56435c7124dd0ce0c8bdd99c52e5d183a0ca7fdcd06c5d5509423843f487dd0b"}, + {file = "pycryptodomex-3.21.0-cp27-cp27mu-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:65d275e3f866cf6fe891411be9c1454fb58809ccc5de6d3770654c47197acd65"}, + {file = "pycryptodomex-3.21.0-cp27-cp27mu-musllinux_1_1_aarch64.whl", hash = "sha256:5241bdb53bcf32a9568770a6584774b1b8109342bd033398e4ff2da052123832"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-macosx_10_9_universal2.whl", hash = "sha256:34325b84c8b380675fd2320d0649cdcbc9cf1e0d1526edbe8fce43ed858cdc7e"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:103c133d6cd832ae7266feb0a65b69e3a5e4dbbd6f3a3ae3211a557fd653f516"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77ac2ea80bcb4b4e1c6a596734c775a1615d23e31794967416afc14852a639d3"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9aa0cf13a1a1128b3e964dc667e5fe5c6235f7d7cfb0277213f0e2a783837cc2"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46eb1f0c8d309da63a2064c28de54e5e614ad17b7e2f88df0faef58ce192fc7b"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:cc7e111e66c274b0df5f4efa679eb31e23c7545d702333dfd2df10ab02c2a2ce"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-musllinux_1_2_i686.whl", hash = "sha256:770d630a5c46605ec83393feaa73a9635a60e55b112e1fb0c3cea84c2897aa0a"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:52e23a0a6e61691134aa8c8beba89de420602541afaae70f66e16060fdcd677e"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-win32.whl", hash = "sha256:a3d77919e6ff56d89aada1bd009b727b874d464cb0e2e3f00a49f7d2e709d76e"}, + {file = "pycryptodomex-3.21.0-cp36-abi3-win_amd64.whl", hash = "sha256:b0e9765f93fe4890f39875e6c90c96cb341767833cfa767f41b490b506fa9ec0"}, + {file = "pycryptodomex-3.21.0-pp27-pypy_73-manylinux2010_x86_64.whl", hash = "sha256:feaecdce4e5c0045e7a287de0c4351284391fe170729aa9182f6bd967631b3a8"}, + {file = "pycryptodomex-3.21.0-pp27-pypy_73-win32.whl", hash = "sha256:365aa5a66d52fd1f9e0530ea97f392c48c409c2f01ff8b9a39c73ed6f527d36c"}, + {file = "pycryptodomex-3.21.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:3efddfc50ac0ca143364042324046800c126a1d63816d532f2e19e6f2d8c0c31"}, + {file = "pycryptodomex-3.21.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0df2608682db8279a9ebbaf05a72f62a321433522ed0e499bc486a6889b96bf3"}, + {file = "pycryptodomex-3.21.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5823d03e904ea3e53aebd6799d6b8ec63b7675b5d2f4a4bd5e3adcb512d03b37"}, + {file = "pycryptodomex-3.21.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:27e84eeff24250ffec32722334749ac2a57a5fd60332cd6a0680090e7c42877e"}, + {file = "pycryptodomex-3.21.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:8ef436cdeea794015263853311f84c1ff0341b98fc7908e8a70595a68cefd971"}, + {file = "pycryptodomex-3.21.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a1058e6dfe827f4209c5cae466e67610bcd0d66f2f037465daa2a29d92d952b"}, + {file = "pycryptodomex-3.21.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9ba09a5b407cbb3bcb325221e346a140605714b5e880741dc9a1e9ecf1688d42"}, + {file = "pycryptodomex-3.21.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8a9d8342cf22b74a746e3c6c9453cb0cfbb55943410e3a2619bd9164b48dc9d9"}, + {file = "pycryptodomex-3.21.0.tar.gz", hash = "sha256:222d0bd05381dd25c32dd6065c071ebf084212ab79bab4599ba9e6a3e0009e6c"}, ] [[package]] name = "pydes" version = "2.0.1" description = "Pure python implementation of DES and TRIPLE DES encryption algorithm" -category = "main" optional = false python-versions = "*" files = [ {file = "pyDes-2.0.1.tar.gz", hash = "sha256:e2ab8e21d2b83e90d90dbfdcb6fb8ac0000b813238b7ecaede04f8435c389012"}, ] +[[package]] +name = "pyelftools" +version = "0.31" +description = "Library for analyzing ELF files and DWARF debugging information" +optional = false +python-versions = "*" +files = [ + {file = "pyelftools-0.31-py3-none-any.whl", hash = "sha256:f52de7b3c7e8c64c8abc04a79a1cf37ac5fb0b8a49809827130b858944840607"}, + {file = "pyelftools-0.31.tar.gz", hash = "sha256:c774416b10310156879443b81187d182d8d9ee499660380e645918b50bc88f99"}, +] + +[[package]] +name = "pyobjc-core" +version = "9.2" +description = "Python<->ObjC Interoperability Module" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyobjc-core-9.2.tar.gz", hash = "sha256:d734b9291fec91ff4e3ae38b9c6839debf02b79c07314476e87da8e90b2c68c3"}, + {file = "pyobjc_core-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fa674a39949f5cde8e5c7bbcd24496446bfc67592b028aedbec7f81dc5fc4daa"}, + {file = "pyobjc_core-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bbc8de304ee322a1ee530b4d2daca135a49b4a49aa3cedc6b2c26c43885f4842"}, + {file = "pyobjc_core-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0fa950f092673883b8bd28bc18397415cabb457bf410920762109b411789ade9"}, + {file = "pyobjc_core-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:586e4cae966282eaa61b21cae66ccdcee9d69c036979def26eebdc08ddebe20f"}, + {file = "pyobjc_core-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:41189c2c680931c0395a55691763c481fc681f454f21bb4f1644f98c24a45954"}, + {file = "pyobjc_core-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:2d23ee539f2ba5e9f5653d75a13f575c7e36586fc0086792739e69e4c2617eda"}, + {file = "pyobjc_core-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b9809cf96678797acb72a758f34932fe8e2602d5ab7abec15c5ac68ddb481720"}, +] + +[[package]] +name = "pyobjc-framework-cocoa" +version = "9.2" +description = "Wrappers for the Cocoa frameworks on macOS" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyobjc-framework-Cocoa-9.2.tar.gz", hash = "sha256:efd78080872d8c8de6c2b97e0e4eac99d6203a5d1637aa135d071d464eb2db53"}, + {file = "pyobjc_framework_Cocoa-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9e02d8a7cc4eb7685377c50ba4f17345701acf4c05b1e7480d421bff9e2f62a4"}, + {file = "pyobjc_framework_Cocoa-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3b1e6287b3149e4c6679cdbccd8e9ef6557a4e492a892e80a77df143f40026d2"}, + {file = "pyobjc_framework_Cocoa-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:312977ce2e3989073c6b324c69ba24283de206fe7acd6dbbbaf3e29238a22537"}, + {file = "pyobjc_framework_Cocoa-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:aae7841cf40c26dd915f4dd828f91c6616e6b7998630b72e704750c09e00f334"}, + {file = "pyobjc_framework_Cocoa-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:739a421e14382a46cbeb9a883f192dceff368ad28ec34d895c48c0ad34cf2c1d"}, + {file = "pyobjc_framework_Cocoa-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:32d9ac1033fac1b821ddee8c68f972a7074ad8c50bec0bea9a719034c1c2fb94"}, + {file = "pyobjc_framework_Cocoa-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b236bb965e41aeb2e215d4e98a5a230d4b63252c6d26e00924ea2e69540a59d6"}, +] + +[package.dependencies] +pyobjc-core = ">=9.2" + +[[package]] +name = "pyobjc-framework-corebluetooth" +version = "9.2" +description = "Wrappers for the framework CoreBluetooth on macOS" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyobjc-framework-CoreBluetooth-9.2.tar.gz", hash = "sha256:cb2481b1dfe211ae9ce55f36537dc8155dbf0dc8ff26e0bc2e13f7afb0a291d1"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_10_9_universal2.whl", hash = "sha256:53d888742119d0f0c725d0b0c2389f68e8f21f0cba6d6aec288c53260a0196b6"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:179532882126526e38fe716a50fb0ee8f440e0b838d290252c515e622b5d0e49"}, + {file = "pyobjc_framework_CoreBluetooth-9.2-cp36-abi3-macosx_11_0_universal2.whl", hash = "sha256:256a5031ea9d8a7406541fa1b0dfac549b1de93deae8284605f9355b13fb58be"}, +] + +[package.dependencies] +pyobjc-core = ">=9.2" +pyobjc-framework-Cocoa = ">=9.2" + +[[package]] +name = "pyobjc-framework-libdispatch" +version = "9.2" +description = "Wrappers for libdispatch on macOS" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyobjc-framework-libdispatch-9.2.tar.gz", hash = "sha256:542e7f7c2b041939db5ed6f3119c1d67d73ec14a996278b92485f8513039c168"}, + {file = "pyobjc_framework_libdispatch-9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:88d4091d4bcb5702783d6e86b4107db973425a17d1de491543f56bd348909b60"}, + {file = "pyobjc_framework_libdispatch-9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1a67b007113328538b57893cc7829a722270764cdbeae6d5e1460a1d911314df"}, + {file = "pyobjc_framework_libdispatch-9.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:6fccea1a57436cf1ac50d9ebc6e3e725bcf77f829ba6b118e62e6ed7866d359d"}, + {file = "pyobjc_framework_libdispatch-9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6eba747b7ad91b0463265a7aee59235bb051fb97687f35ca2233690369b5e4e4"}, + {file = "pyobjc_framework_libdispatch-9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2e835495860d04f63c2d2f73ae3dd79da4222864c107096dc0f99e8382700026"}, + {file = "pyobjc_framework_libdispatch-9.2-cp38-cp38-macosx_11_0_universal2.whl", hash = "sha256:1b107e5c3580b09553030961ea6b17abad4a5132101eab1af3ad2cb36d0f08bb"}, + {file = "pyobjc_framework_libdispatch-9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:83cdb672acf722717b5ecf004768f215f02ac02d7f7f2a9703da6e921ab02222"}, +] + +[package.dependencies] +pyobjc-core = ">=9.2" + [[package]] name = "pyserial" version = "3.5" description = "Python Serial Port Extension" -category = "main" optional = false python-versions = "*" files = [ @@ -923,7 +1207,6 @@ cp2110 = ["hidapi"] name = "pytest" version = "7.1.3" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -948,7 +1231,6 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2. name = "pytest-asyncio" version = "0.19.0" description = "Pytest support for asyncio" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -967,7 +1249,6 @@ testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy name = "python-dateutil" version = "2.8.2" description = "Extensions to the standard Python datetime module" -category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ @@ -978,11 +1259,21 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "python-gnupg" +version = "0.5.3" +description = "A wrapper for the Gnu Privacy Guard (GPG or GnuPG)" +optional = false +python-versions = "*" +files = [ + {file = "python-gnupg-0.5.3.tar.gz", hash = "sha256:290d8ddb9cd63df96cfe9284b9b265f19fd6e145e5582dc58fd7271f026d0a47"}, + {file = "python_gnupg-0.5.3-py2.py3-none-any.whl", hash = "sha256:2f8a4c6f63766feca6cc1416408f8b84e1b914fe7b54514e570fc5cbe92e9248"}, +] + [[package]] name = "python-u2flib-host" version = "3.0.3" description = "Python based U2F host library" -category = "main" optional = false python-versions = "*" files = [ @@ -998,21 +1289,20 @@ soft-device = ["cryptography (>=1.0)"] [[package]] name = "requests" -version = "2.28.2" +version = "2.31.0" description = "Python HTTP for Humans." -category = "main" optional = false -python-versions = ">=3.7, <4" +python-versions = ">=3.7" files = [ - {file = "requests-2.28.2-py3-none-any.whl", hash = "sha256:64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa"}, - {file = "requests-2.28.2.tar.gz", hash = "sha256:98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf"}, + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, ] [package.dependencies] certifi = ">=2017.4.17" charset-normalizer = ">=2,<4" idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<1.27" +urllib3 = ">=1.21.1,<3" [package.extras] socks = ["PySocks (>=1.5.6,!=1.5.7)"] @@ -1020,38 +1310,35 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "setuptools" -version = "67.6.0" +version = "68.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.6.0-py3-none-any.whl", hash = "sha256:b78aaa36f6b90a074c1fa651168723acbf45d14cb1196b6f02c0fd07f17623b2"}, - {file = "setuptools-67.6.0.tar.gz", hash = "sha256:2ee892cd5f29f3373097f5a814697e397cf3ce313616df0af11231e2ad118077"}, + {file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"}, + {file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "six" -version = "1.16.0" +version = "1.17.0" description = "Python 2 and 3 compatibility utilities" -category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] [[package]] name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1061,43 +1348,41 @@ files = [ [[package]] name = "typing-extensions" -version = "4.5.0" +version = "4.7.1" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.5.0-py3-none-any.whl", hash = "sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4"}, - {file = "typing_extensions-4.5.0.tar.gz", hash = "sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb"}, + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, ] [[package]] name = "urllib3" -version = "1.26.15" +version = "2.0.7" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.7" files = [ - {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, - {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, + {file = "urllib3-2.0.7-py3-none-any.whl", hash = "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e"}, + {file = "urllib3-2.0.7.tar.gz", hash = "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84"}, ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] [[package]] name = "websocket-client" -version = "1.5.1" +version = "1.6.1" description = "WebSocket client for Python with low level API options" -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "websocket-client-1.5.1.tar.gz", hash = "sha256:3f09e6d8230892547132177f575a4e3e73cfdf06526e20cc02aa1c3b47184d40"}, - {file = "websocket_client-1.5.1-py3-none-any.whl", hash = "sha256:cdf5877568b7e83aa7cf2244ab56a3213de587bbe0ce9d8b9600fc77b455d89e"}, + {file = "websocket-client-1.6.1.tar.gz", hash = "sha256:c951af98631d24f8df89ab1019fc365f2227c0892f12fd150e935607c79dd0dd"}, + {file = "websocket_client-1.6.1-py3-none-any.whl", hash = "sha256:f1f9f2ad5291f0225a49efad77abf9e700b6fef553900623060dad6e26503b9d"}, ] [package.extras] @@ -1109,7 +1394,6 @@ test = ["websockets"] name = "zipp" version = "3.15.0" description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1124,4 +1408,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "2e919242ea1a1329fd81a7a7b6e76f91d257561a9a40c0cc66f45167f866ef34" +content-hash = "a09a729b8f48f9c70e74a30fbf06c682ab904019b3100bac47d0eda1a2786387" diff --git a/pyband/client.py b/pyband/client.py index 531fc17..f02118e 100644 --- a/pyband/client.py +++ b/pyband/client.py @@ -5,15 +5,46 @@ from .data import ReferencePrice, ReferencePriceUpdated from .exceptions import NotFoundError, EmptyMsgError -from .proto.cosmos.auth.v1beta1 import BaseAccount, QueryAccountRequest +from .proto.cosmos.auth.v1beta1 import ( + BaseAccount, + QueryAccountInfoRequest, +) from .proto.cosmos.auth.v1beta1 import QueryStub as AuthQueryStub from .proto.cosmos.base.abci.v1beta1 import TxResponse -from .proto.cosmos.base.tendermint.v1beta1 import GetLatestBlockRequest, GetLatestBlockResponse +from .proto.cosmos.base.tendermint.v1beta1 import ( + GetLatestBlockRequest, + GetLatestBlockResponse, +) from .proto.cosmos.base.tendermint.v1beta1 import ServiceStub as TendermintServiceStub -from .proto.cosmos.crypto.secp256k1 import PubKey -from .proto.cosmos.tx.v1beta1 import GetTxRequest, BroadcastTxRequest, BroadcastMode, SimulateRequest, SimulateResponse +from .proto.cosmos.tx.v1beta1 import ( + GetTxRequest, + BroadcastTxRequest, + BroadcastMode, + SimulateRequest, + SimulateResponse, +) from .proto.cosmos.tx.v1beta1 import ServiceStub as TxServiceStub -from .proto.oracle.v1 import ( +from .proto.band.bandtss.v1beta1 import ( + MsgStub as BandTssMsgStub, + QueryStub as BandTssQueryStub, +) +from .proto.band.feeds.v1beta1 import ( + MsgStub as FeedsMsgStub, + QueryStub as FeedsQueryStub, + QueryCurrentFeedsRequest, + QueryCurrentFeedsResponse, + QueryPriceRequest, + QueryPriceResponse, + QueryPricesRequest, + QueryPricesResponse, +) +from .proto.band.globalfee.v1beta1 import ( + MsgStub as GlobalFeeMsgStub, + QueryStub as GlobalFeeQueryStub, +) +from .proto.band.oracle.v1 import ( + MsgStub as OracleMsgStub, + QueryStub as OracleQueryStub, DataSource, OracleScript, QueryDataSourceRequest, @@ -25,8 +56,18 @@ QueryRequestSearchRequest, QueryRequestSearchResponse, ) -from .proto.oracle.v1 import MsgStub as OracleMsgStub -from .proto.oracle.v1 import QueryStub as OracleQueryStub +from .proto.band.restake.v1beta1 import ( + MsgStub as RestakeMsgStub, + QueryStub as RestakeQueryStub, +) +from .proto.band.tss.v1beta1 import ( + MsgStub as TssMsgStub, + QueryStub as TssQueryStub, +) +from .proto.band.tunnel.v1beta1 import ( + MsgStub as TunnelMsgStub, + QueryStub as TunnelQueryStub, +) class Client: @@ -34,11 +75,39 @@ class Client: def __init__(self, channel: Channel): self.__channel = channel - self.stub_oracle = OracleQueryStub(self.__channel) - self.stub_cosmos_tendermint = TendermintServiceStub(self.__channel) - self.stub_auth = AuthQueryStub(self.__channel) - self.stub_tx = TxServiceStub(self.__channel) - self.stub_oracle_tx = OracleMsgStub(self.__channel) + + # band.bandtss + self.band_tss_query_stub = BandTssQueryStub(self.__channel) + self.band_tss_msg_stub = BandTssMsgStub(self.__channel) + + # band.feeds + self.feeds_query_stub = FeedsQueryStub(self.__channel) + self.feeds_msg_stub = FeedsMsgStub(self.__channel) + + # band.global_fee + self.global_fee_query_stub = GlobalFeeQueryStub(self.__channel) + self.global_fee_msg_stub = GlobalFeeMsgStub(self.__channel) + + # band.oracle + self.oracle_query_stub = OracleQueryStub(self.__channel) + self.oracle_msg_stub = OracleMsgStub(self.__channel) + + # band.restake + self.restake_query_stub = RestakeQueryStub(self.__channel) + self.restake_msg_stub = RestakeMsgStub(self.__channel) + + # band.tss + self.tss_query_stub = TssQueryStub(self.__channel) + self.tss_msg_stub = TssMsgStub(self.__channel) + + # band.tunnel + self.tunnel_query_stub = TunnelQueryStub(self.__channel) + self.tunnel_msg_stub = TunnelMsgStub(self.__channel) + + # cosmos + self.tendermint_service_stub = TendermintServiceStub(self.__channel) + self.auth_query_stub = AuthQueryStub(self.__channel) + self.tx_service_stub = TxServiceStub(self.__channel) def __del__(self) -> None: self.close() @@ -46,7 +115,10 @@ def __del__(self) -> None: def close(self) -> None: """Closes the connection.""" - self.__channel.close() + try: + self.__channel.close() + except Exception: + pass @classmethod def from_endpoint(cls, grpc_endpoint: str, port: int, ssl: bool = True): @@ -73,7 +145,9 @@ async def get_data_source(self, id: int) -> DataSource: The data source details. """ - resp = await self.stub_oracle.data_source(QueryDataSourceRequest(data_source_id=id)) + resp = await self.oracle_query_stub.data_source( + QueryDataSourceRequest(data_source_id=id) + ) return resp.data_source async def get_oracle_script(self, id: int) -> OracleScript: @@ -86,7 +160,9 @@ async def get_oracle_script(self, id: int) -> OracleScript: The oracle script details. """ - resp = await self.stub_oracle.oracle_script(QueryOracleScriptRequest(oracle_script_id=id)) + resp = await self.oracle_query_stub.oracle_script( + QueryOracleScriptRequest(oracle_script_id=id) + ) return resp.oracle_script async def get_request_by_id(self, id: int) -> QueryRequestResponse: @@ -99,7 +175,7 @@ async def get_request_by_id(self, id: int) -> QueryRequestResponse: The request details. """ - resp = await self.stub_oracle.request(QueryRequestRequest(request_id=id)) + resp = await self.oracle_query_stub.request(QueryRequestRequest(request_id=id)) return resp async def get_reporters(self, validator: str) -> List[str]: @@ -112,7 +188,9 @@ async def get_reporters(self, validator: str) -> List[str]: A list of reporter addresses. """ - resp = await self.stub_oracle.reporters(QueryReportersRequest(validator_address=validator)) + resp = await self.oracle_query_stub.reporters( + QueryReportersRequest(validator_address=validator) + ) return resp.reporter async def get_latest_block(self) -> GetLatestBlockResponse: @@ -122,7 +200,9 @@ async def get_latest_block(self) -> GetLatestBlockResponse: The details of the latest block. """ - return await self.stub_cosmos_tendermint.get_latest_block(GetLatestBlockRequest()) + return await self.tendermint_service_stub.get_latest_block( + GetLatestBlockRequest() + ) async def get_account(self, address: str) -> BaseAccount: """Gets the account details of a specified address. @@ -135,17 +215,13 @@ async def get_account(self, address: str) -> BaseAccount: """ try: - resp = await self.stub_auth.account(QueryAccountRequest(address=address)) - account = BaseAccount() - pub_key = PubKey() - - account.parse(resp.account.value) - account.pub_key = pub_key.parse(account.pub_key.value) + resp = await self.auth_query_stub.account_info( + QueryAccountInfoRequest(address=address) + ) + return resp.info except Exception as e: raise e - return account - async def get_request_id_by_tx_hash(self, tx_hash: str) -> List[int]: """Gets the request ID of a given transaction hash. @@ -156,10 +232,15 @@ async def get_request_id_by_tx_hash(self, tx_hash: str) -> List[int]: A list of request IDs. """ - tx = await self.stub_tx.get_tx(GetTxRequest(hash=tx_hash)) + tx = await self.tx_service_stub.get_tx(GetTxRequest(hash=tx_hash)) request_ids = [] + print(tx.tx_response.logs) for log in tx.tx_response.logs: - request_event = [event for event in log.events if event.type == "request" or event.type == "report"] + request_event = [ + event + for event in log.events + if event.type == "request" or event.type == "report" + ] if len(request_event) == 1: attrs = request_event[0].attributes attr_id = [attr for attr in attrs if attr.key == "id"] @@ -182,8 +263,8 @@ async def send_tx_sync_mode(self, tx_bytes: bytes) -> TxResponse: The transaction response. """ - resp = await self.stub_tx.broadcast_tx( - BroadcastTxRequest(tx_bytes=tx_bytes, mode=BroadcastMode.BROADCAST_MODE_SYNC) + resp = await self.tx_service_stub.broadcast_tx( + BroadcastTxRequest(tx_bytes=tx_bytes, mode=BroadcastMode.SYNC) ) return resp.tx_response @@ -199,25 +280,8 @@ async def send_tx_async_mode(self, tx_bytes: bytes) -> TxResponse: The transaction response. """ - resp = await self.stub_tx.broadcast_tx( - BroadcastTxRequest(tx_bytes=tx_bytes, mode=BroadcastMode.BROADCAST_MODE_ASYNC) - ) - return resp.tx_response - - async def send_tx_block_mode(self, tx_bytes: bytes) -> TxResponse: - """Sends a transaction in block mode. - - Sends a transaction and waits until the transaction has been committed to a block before returning the response. - - Args: - tx_bytes: A signed transaction in raw bytes. - - Returns: - The transaction response. - """ - - resp = await self.stub_tx.broadcast_tx( - BroadcastTxRequest(tx_bytes=tx_bytes, mode=BroadcastMode.BROADCAST_MODE_BLOCK) + resp = await self.tx_service_stub.broadcast_tx( + BroadcastTxRequest(tx_bytes=tx_bytes, mode=BroadcastMode.ASYNC) ) return resp.tx_response @@ -231,7 +295,9 @@ async def get_chain_id(self) -> str: latest_block = await self.get_latest_block() return latest_block.block.header.chain_id - async def get_reference_data(self, pairs: List[str], min_count: int, ask_count: int) -> List[ReferencePrice]: + async def get_reference_data( + self, pairs: List[str], min_count: int, ask_count: int + ) -> List[ReferencePrice]: """Gets the rates of the given cryptocurrency pairs. Args: @@ -246,9 +312,11 @@ async def get_reference_data(self, pairs: List[str], min_count: int, ask_count: if len(pairs) == 0: raise EmptyMsgError("Pairs are required") - symbols = set([symbol for pair in pairs for symbol in pair.split("/") if symbol != "USD"]) + symbols = set( + [symbol for pair in pairs for symbol in pair.split("/") if symbol != "USD"] + ) - price_data = await self.stub_oracle.request_price( + price_data = await self.oracle_query_stub.request_price( QueryRequestPriceRequest( symbols=list(symbols), min_count=min_count, @@ -275,8 +343,12 @@ async def get_reference_data(self, pairs: List[str], min_count: int, ask_count: for pair in pairs: base_symbol, quote_symbol = pair.split("/") - quote_rate = int(symbol_dict[base_symbol]["px"]) / int(symbol_dict[base_symbol]["multiplier"]) - base_rate = int(symbol_dict[quote_symbol]["px"]) / int(symbol_dict[quote_symbol]["multiplier"]) + quote_rate = int(symbol_dict[base_symbol]["px"]) / int( + symbol_dict[base_symbol]["multiplier"] + ) + base_rate = int(symbol_dict[quote_symbol]["px"]) / int( + symbol_dict[quote_symbol]["multiplier"] + ) rate = quote_rate / base_rate rate_updated_at = ReferencePriceUpdated( @@ -302,9 +374,12 @@ async def get_latest_request( Returns: The request details. """ - return await self.stub_oracle.request_search( + return await self.oracle_query_stub.request_search( QueryRequestSearchRequest( - oracle_script_id=oid, calldata=calldata, ask_count=ask_count, min_count=min_count + oracle_script_id=oid, + calldata=calldata, + ask_count=ask_count, + min_count=min_count, ) ) @@ -317,9 +392,44 @@ async def get_tx_response(self, tx_hash: str) -> TxResponse: Returns: The tx response. """ - resp = await self.stub_tx.get_tx(GetTxRequest(hash=tx_hash)) + resp = await self.tx_service_stub.get_tx(GetTxRequest(hash=tx_hash)) return resp.tx_response + async def get_current_feeds(self) -> QueryCurrentFeedsResponse: + """Gets the current feeds. + + Returns: + The current feeds. + """ + + return await self.feeds_query_stub.current_feeds(QueryCurrentFeedsRequest()) + + async def get_feed_price(self, signal_id: str) -> QueryPriceResponse: + """Gets the price of a signal id. + + Args: + signal_id: The signal id to get the price of + + Returns: + The price of the specified feed. + """ + + return await self.feeds_query_stub.price(QueryPriceRequest(signal_id=signal_id)) + + async def get_feed_prices(self, signal_ids: List[str]) -> QueryPricesResponse: + """Gets the prices the signal_ids. + + Args: + signal_ids: A list of signal ids of which to get the price for + + Returns: + The prices of the specified feeds. + """ + + return await self.feeds_query_stub.prices( + QueryPricesRequest(signal_ids=signal_ids) + ) + async def simulate_tx(self, tx_bytes: bytes) -> SimulateResponse: """Simulates a transaction from the tx_bytes. @@ -329,4 +439,4 @@ async def simulate_tx(self, tx_bytes: bytes) -> SimulateResponse: Returns: The simulated response. """ - return await self.stub_tx.simulate(SimulateRequest(tx_bytes=tx_bytes)) + return await self.tx_service_stub.simulate(SimulateRequest(tx_bytes=tx_bytes)) diff --git a/pyband/cosmos_app.py b/pyband/cosmos_app.py index f43f1d0..ec7189e 100644 --- a/pyband/cosmos_app.py +++ b/pyband/cosmos_app.py @@ -52,7 +52,9 @@ def __init__(self, cla: int, major: int, minor: int, patch: int): self.patch = patch def __repr__(self): - return "AppVersion(cla={}, major={}, minor={}, patch={})".format(*self.__iter__()) + return "AppVersion(cla={}, major={}, minor={}, patch={})".format( + *self.__iter__() + ) class SepcAddr(CosmosAppResults): @@ -181,7 +183,8 @@ def sign_secp256k1(self, msg: bytes) -> bytearray: INS=b"\x02", P1=payload_desc, P2=b"\x00", - data=packet, + L=len(packet).to_bytes(1, "big"), + data=bytes(packet), ) try: resp = self.dongle.exchange(command.get_message()) diff --git a/pyband/messages/oracle/__init__.py b/pyband/messages/band/__init__.py similarity index 100% rename from pyband/messages/oracle/__init__.py rename to pyband/messages/band/__init__.py diff --git a/pyband/proto/cosmos/base/kv/__init__.py b/pyband/messages/band/bandtss/__init__.py similarity index 100% rename from pyband/proto/cosmos/base/kv/__init__.py rename to pyband/messages/band/bandtss/__init__.py diff --git a/pyband/messages/band/bandtss/v1beta1/__init__.py b/pyband/messages/band/bandtss/v1beta1/__init__.py new file mode 100644 index 0000000..448a6d3 --- /dev/null +++ b/pyband/messages/band/bandtss/v1beta1/__init__.py @@ -0,0 +1,7 @@ +from .msgs import ( + MsgRequestSignature, + MsgActivate, + MsgUpdateParams, + MsgTransitionGroup, + MsgForceTransitionGroup, +) diff --git a/pyband/messages/band/bandtss/v1beta1/msgs.py b/pyband/messages/band/bandtss/v1beta1/msgs.py new file mode 100644 index 0000000..ab7f487 --- /dev/null +++ b/pyband/messages/band/bandtss/v1beta1/msgs.py @@ -0,0 +1,58 @@ +from pyband.messages.base import BaseMessageWrapper +from pyband.proto.band.bandtss.v1beta1 import ( + MsgRequestSignature as MsgRequestSignatureProto, + MsgActivate as MsgActivateProto, + MsgUpdateParams as MsgUpdateParamsProto, + MsgTransitionGroup as MsgTransitionGroupProto, + MsgForceTransitionGroup as MsgForceTransitionGroupProto, +) + + +class MsgRequestSignature(BaseMessageWrapper, MsgRequestSignatureProto): + @property + def type_url(self): + return "/band.bandtss.v1beta1.MsgRequestData" + + @property + def legacy_url(self): + return "bandtss/MsgRequestSignature" + + +class MsgActivate(BaseMessageWrapper, MsgActivateProto): + @property + def type_url(self): + return "/band.bandtss.v1beta1.MsgActivate" + + @property + def legacy_url(self): + return "bandtss/MsgActivate" + + +class MsgUpdateParams(BaseMessageWrapper, MsgUpdateParamsProto): + @property + def type_url(self): + return "/band.bandtss.v1beta1.MsgUpdateParams" + + @property + def legacy_url(self): + return "bandtss/MsgUpdateParams" + + +class MsgTransitionGroup(BaseMessageWrapper, MsgTransitionGroupProto): + @property + def type_url(self): + return "/band.bandtss.v1beta1.MsgTransitionGroup" + + @property + def legacy_url(self): + return "bandtss/MsgTransitionGroup" + + +class MsgForceTransitionGroup(BaseMessageWrapper, MsgForceTransitionGroupProto): + @property + def type_url(self): + return "/band.bandtss.v1beta1.MsgForceTransitionGroup" + + @property + def legacy_url(self): + return "bandtss/MsgForceTransitionGroup" diff --git a/pyband/proto/cosmos/base/snapshots/__init__.py b/pyband/messages/band/feeds/__init__.py similarity index 100% rename from pyband/proto/cosmos/base/snapshots/__init__.py rename to pyband/messages/band/feeds/__init__.py diff --git a/pyband/messages/band/feeds/v1beta1/__init__.py b/pyband/messages/band/feeds/v1beta1/__init__.py new file mode 100644 index 0000000..f38a305 --- /dev/null +++ b/pyband/messages/band/feeds/v1beta1/__init__.py @@ -0,0 +1,6 @@ +from .msgs import ( + MsgVote, + MsgSubmitSignalPrices, + MsgUpdateReferenceSourceConfig, + MsgUpdateParams, +) diff --git a/pyband/messages/band/feeds/v1beta1/msgs.py b/pyband/messages/band/feeds/v1beta1/msgs.py new file mode 100644 index 0000000..6b27f1e --- /dev/null +++ b/pyband/messages/band/feeds/v1beta1/msgs.py @@ -0,0 +1,49 @@ +from pyband.messages.base import BaseMessageWrapper +from pyband.proto.band.feeds.v1beta1 import ( + MsgVote as MsgVoteProto, + MsgSubmitSignalPrices as MsgSubmitSignalPricesProto, + MsgUpdateReferenceSourceConfig as MsgUpdateReferenceSourceConfigProto, + MsgUpdateParams as MsgUpdateParamsProto, +) + + +class MsgVote(BaseMessageWrapper, MsgVoteProto): + @property + def type_url(self): + return "/band.feeds.v1beta1.MsgVote" + + @property + def legacy_url(self): + return "feeds/MsgVote" + + +class MsgSubmitSignalPrices(BaseMessageWrapper, MsgSubmitSignalPricesProto): + @property + def type_url(self): + return "/band.feeds.v1beta1.MsgSubmitSignalPrices" + + @property + def legacy_url(self): + return "feeds/MsgSubmitSignalPrices" + + +class MsgUpdateReferenceSourceConfig( + BaseMessageWrapper, MsgUpdateReferenceSourceConfigProto +): + @property + def type_url(self): + return "/band.feeds.v1beta1.MsgUpdateReferenceSourceConfig" + + @property + def legacy_url(self): + return "feeds/MsgUpdateReferenceSourceConfig" + + +class MsgUpdateParams(BaseMessageWrapper, MsgUpdateParamsProto): + @property + def type_url(self): + return "/band.feeds.v1beta1.MsgUpdateParams" + + @property + def legacy_url(self): + return "feeds/MsgUpdateParams" diff --git a/pyband/proto/cosmos/base/store/__init__.py b/pyband/messages/band/globalfee/__init__.py similarity index 100% rename from pyband/proto/cosmos/base/store/__init__.py rename to pyband/messages/band/globalfee/__init__.py diff --git a/pyband/messages/band/globalfee/v1beta1/__init__.py b/pyband/messages/band/globalfee/v1beta1/__init__.py new file mode 100644 index 0000000..6efa939 --- /dev/null +++ b/pyband/messages/band/globalfee/v1beta1/__init__.py @@ -0,0 +1 @@ +from .msgs import MsgUpdateParams diff --git a/pyband/messages/band/globalfee/v1beta1/msgs.py b/pyband/messages/band/globalfee/v1beta1/msgs.py new file mode 100644 index 0000000..0689425 --- /dev/null +++ b/pyband/messages/band/globalfee/v1beta1/msgs.py @@ -0,0 +1,14 @@ +from pyband.messages.base import BaseMessageWrapper +from pyband.proto.band.globalfee.v1beta1 import ( + MsgUpdateParams as MsgUpdateParamsProto, +) + + +class MsgUpdateParams(BaseMessageWrapper, MsgUpdateParamsProto): + @property + def type_url(self): + return "/band.globalfee.v1beta1.MsgUpdateParams" + + @property + def legacy_url(self): + return "globalfee/MsgUpdateParams" diff --git a/pyband/proto/cosmos/capability/__init__.py b/pyband/messages/band/oracle/__init__.py similarity index 100% rename from pyband/proto/cosmos/capability/__init__.py rename to pyband/messages/band/oracle/__init__.py diff --git a/pyband/messages/oracle/v1/__init__.py b/pyband/messages/band/oracle/v1/__init__.py similarity index 100% rename from pyband/messages/oracle/v1/__init__.py rename to pyband/messages/band/oracle/v1/__init__.py diff --git a/pyband/messages/oracle/v1/msgs.py b/pyband/messages/band/oracle/v1/msgs.py similarity index 54% rename from pyband/messages/oracle/v1/msgs.py rename to pyband/messages/band/oracle/v1/msgs.py index 16ff801..9ab41c2 100644 --- a/pyband/messages/oracle/v1/msgs.py +++ b/pyband/messages/band/oracle/v1/msgs.py @@ -1,12 +1,12 @@ -from dataclasses import dataclass +import dataclasses -from ....messages.base import BaseMessageWrapper -from ....proto.cosmos.base import v1beta1 as __cosmos_base_v1_beta1__ -from ....proto.oracle.v1 import MsgCreateDataSource as MsgCreateDataSourceProto -from ....proto.oracle.v1 import MsgCreateOracleScript as MsgCreateOracleScriptProto -from ....proto.oracle.v1 import MsgEditDataSource as MsgEditDataSourceProto -from ....proto.oracle.v1 import MsgEditOracleScript as MsgEditOracleScriptProto -from ....proto.oracle.v1 import MsgRequestData as MsgRequestDataProto +from ....base import BaseMessageWrapper +from .....proto.cosmos.base import v1beta1 as __cosmos_base_v1_beta1__ +from .....proto.band.oracle.v1 import MsgCreateDataSource as MsgCreateDataSourceProto +from .....proto.band.oracle.v1 import MsgCreateOracleScript as MsgCreateOracleScriptProto +from .....proto.band.oracle.v1 import MsgEditDataSource as MsgEditDataSourceProto +from .....proto.band.oracle.v1 import MsgEditOracleScript as MsgEditOracleScriptProto +from .....proto.band.oracle.v1 import MsgRequestData as MsgRequestDataProto assert __cosmos_base_v1_beta1__ @@ -14,17 +14,18 @@ class MsgRequestData(BaseMessageWrapper, MsgRequestDataProto): @property def type_url(self): - return "/oracle.v1.MsgRequestData" + return "/band.oracle.v1.MsgRequestData" @property def legacy_url(self): return "oracle/Request" +@dataclasses.dataclass class MsgCreateDataSource(BaseMessageWrapper, MsgCreateDataSourceProto): @property def type_url(self): - return "/oracle.v1.MsgCreateDataSource" + return "/band.oracle.v1.MsgCreateDataSource" @property def legacy_url(self): @@ -34,7 +35,7 @@ def legacy_url(self): class MsgEditDataSource(BaseMessageWrapper, MsgEditDataSourceProto): @property def type_url(self): - return "/oracle.v1.MsgEditDataSource" + return "/band.oracle.v1.MsgEditDataSource" @property def legacy_url(self): @@ -44,7 +45,7 @@ def legacy_url(self): class MsgCreateOracleScript(BaseMessageWrapper, MsgCreateOracleScriptProto): @property def type_url(self): - return "/oracle.v1.MsgCreateOracleScript" + return "/band.oracle.v1.MsgCreateOracleScript" @property def legacy_url(self): @@ -54,7 +55,7 @@ def legacy_url(self): class MsgEditOracleScript(BaseMessageWrapper, MsgEditOracleScriptProto): @property def type_url(self): - return "/oracle.v1.MsgEditOracleScript" + return "/band.oracle.v1.MsgEditOracleScript" @property def legacy_url(self): diff --git a/pyband/proto/oracle/__init__.py b/pyband/messages/band/restake/__init__.py similarity index 100% rename from pyband/proto/oracle/__init__.py rename to pyband/messages/band/restake/__init__.py diff --git a/pyband/messages/band/restake/v1beta1/__init__.py b/pyband/messages/band/restake/v1beta1/__init__.py new file mode 100644 index 0000000..a57ddad --- /dev/null +++ b/pyband/messages/band/restake/v1beta1/__init__.py @@ -0,0 +1 @@ +from .msgs import MsgStake, MsgUnstake, MsgUpdateParams diff --git a/pyband/messages/band/restake/v1beta1/msgs.py b/pyband/messages/band/restake/v1beta1/msgs.py new file mode 100644 index 0000000..859bed6 --- /dev/null +++ b/pyband/messages/band/restake/v1beta1/msgs.py @@ -0,0 +1,36 @@ +from pyband.messages.base import BaseMessageWrapper +from pyband.proto.band.restake.v1beta1 import ( + MsgStake as MsgStakeProto, + MsgUnstake as MsgUnstakeProto, + MsgUpdateParams as MsgUpdateParamsProto, +) + + +class MsgStake(BaseMessageWrapper, MsgStakeProto): + @property + def type_url(self): + return "/band.restake.v1beta1.MsgStake" + + @property + def legacy_url(self): + return "restake/MsgStake" + + +class MsgUnstake(BaseMessageWrapper, MsgUnstakeProto): + @property + def type_url(self): + return "/band.restake.v1beta1.MsgUnstake" + + @property + def legacy_url(self): + return "restake/MsgUnstake" + + +class MsgUpdateParams(BaseMessageWrapper, MsgUpdateParamsProto): + @property + def type_url(self): + return "/band.restake.v1beta1.MsgUpdateParams" + + @property + def legacy_url(self): + return "restake/MsgUpdateParams" diff --git a/pyband/messages/band/tss/__init__.py b/pyband/messages/band/tss/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/messages/band/tss/v1beta1/__init__.py b/pyband/messages/band/tss/v1beta1/__init__.py new file mode 100644 index 0000000..018f8ff --- /dev/null +++ b/pyband/messages/band/tss/v1beta1/__init__.py @@ -0,0 +1,10 @@ +from .msgs import ( + MsgSubmitDkgRound1, + MsgSubmitDkgRound2, + MsgComplain, + MsgConfirm, + MsgSubmitDEs, + MsgResetDE, + MsgSubmitSignature, + MsgUpdateParams, +) diff --git a/pyband/messages/band/tss/v1beta1/msgs.py b/pyband/messages/band/tss/v1beta1/msgs.py new file mode 100644 index 0000000..acb0ea6 --- /dev/null +++ b/pyband/messages/band/tss/v1beta1/msgs.py @@ -0,0 +1,91 @@ +from pyband.messages.base import BaseMessageWrapper +from pyband.proto.band.tss.v1beta1 import ( + MsgSubmitDkgRound1 as MsgSubmitDkgRound1Proto, + MsgSubmitDkgRound2 as MsgSubmitDkgRound2Proto, + MsgComplain as MsgComplainProto, + MsgConfirm as MsgConfirmProto, + MsgSubmitDEs as MsgSubmitDEsProto, + MsgResetDE as MsgResetDEProto, + MsgSubmitSignature as MsgSubmitSignatureProto, + MsgUpdateParams as MsgUpdateParamsProto, +) + + +class MsgSubmitDkgRound1(BaseMessageWrapper, MsgSubmitDkgRound1Proto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgSubmitDkgRound1" + + @property + def legacy_url(self): + return "tss/MsgSubmitDkgRound1" + + +class MsgSubmitDkgRound2(BaseMessageWrapper, MsgSubmitDkgRound2Proto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgSubmitDkgRound2" + + @property + def legacy_url(self): + return "tss/MsgSubmitDkgRound2" + + +class MsgComplain(BaseMessageWrapper, MsgComplainProto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgComplaint" + + @property + def legacy_url(self): + return "tss/MsgComplaint" + + +class MsgConfirm(BaseMessageWrapper, MsgConfirmProto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgConfirm" + + @property + def legacy_url(self): + return "tss/MsgConfirm" + + +class MsgSubmitDEs(BaseMessageWrapper, MsgSubmitDEsProto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgSubmitDEs" + + @property + def legacy_url(self): + return "tss/MsgSubmitDEs" + + +class MsgResetDE(BaseMessageWrapper, MsgResetDEProto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgResetDE" + + @property + def legacy_url(self): + return "tss/MsgResetDE" + + +class MsgSubmitSignature(BaseMessageWrapper, MsgSubmitSignatureProto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgSubmitSignature" + + @property + def legacy_url(self): + return "tss/MsgSubmitSignature" + + +class MsgUpdateParams(BaseMessageWrapper, MsgUpdateParamsProto): + @property + def type_url(self): + return "/band.tss.v1beta1.MsgUpdateParams" + + @property + def legacy_url(self): + return "tss/MsgUpdateParams" diff --git a/pyband/messages/band/tunnel/__init__.py b/pyband/messages/band/tunnel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/messages/band/tunnel/v1beta1/__init__.py b/pyband/messages/band/tunnel/v1beta1/__init__.py new file mode 100644 index 0000000..425ac23 --- /dev/null +++ b/pyband/messages/band/tunnel/v1beta1/__init__.py @@ -0,0 +1,9 @@ +from .msgs import ( + MsgCreateTunnel, + MsgUpdateAndResetTunnel, + MsgActivateTunnel, + MsgDeactivateTunnel, + MsgTriggerTunnel, + MsgDepositToTunnel, + MsgWithdrawFromTunnel, +) diff --git a/pyband/messages/band/tunnel/v1beta1/msgs.py b/pyband/messages/band/tunnel/v1beta1/msgs.py new file mode 100644 index 0000000..b690f7b --- /dev/null +++ b/pyband/messages/band/tunnel/v1beta1/msgs.py @@ -0,0 +1,91 @@ +from pyband.messages.base import BaseMessageWrapper +from pyband.proto.band.tunnel.v1beta1 import ( + MsgCreateTunnel as MsgCreateTunnelProto, + MsgUpdateRoute as MsgUpdateRouteProto, + MsgUpdateSignalsAndInterval as MsgUpdateSignalsAndIntervalProto, + MsgActivateTunnel as MsgActivateTunnelProto, + MsgDeactivateTunnel as MsgDeactivateTunnelProto, + MsgTriggerTunnel as MsgTriggerTunnelProto, + MsgDepositToTunnel as MsgDepositToTunnelProto, + MsgWithdrawFromTunnel as MsgWithdrawFromTunnelProto, +) + + +class MsgCreateTunnel(BaseMessageWrapper, MsgCreateTunnelProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgCreateTunnel" + + @property + def legacy_url(self): + return "tunnel/MsgCreateTunnel" + + +class MsgUpdateRoute(BaseMessageWrapper, MsgUpdateRouteProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgUpdateRoute" + + @property + def legacy_url(self): + return "tunnel/MsgUpdateRoute" + + +class MsgUpdateSignalsAndInterval(BaseMessageWrapper, MsgUpdateSignalsAndIntervalProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgUpdateSignalsAndInterval" + + @property + def legacy_url(self): + return "tunnel/MsgUpdateSignalsAndInterval" + + +class MsgActivateTunnel(BaseMessageWrapper, MsgActivateTunnelProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgActivateTunnel" + + @property + def legacy_url(self): + return "tunnel/MsgActivateTunnel" + + +class MsgDeactivateTunnel(BaseMessageWrapper, MsgDeactivateTunnelProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgDeactivateTunnel" + + @property + def legacy_url(self): + return "tunnel/MsgDeactivateTunnel" + + +class MsgTriggerTunnel(BaseMessageWrapper, MsgTriggerTunnelProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgTriggerTunnel" + + @property + def legacy_url(self): + return "tunnel/MsgTriggerTunnel" + + +class MsgDepositToTunnel(BaseMessageWrapper, MsgDepositToTunnelProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgDepositToTunnel" + + @property + def legacy_url(self): + return "tunnel/MsgDepositToTunnel" + + +class MsgWithdrawFromTunnel(BaseMessageWrapper, MsgWithdrawFromTunnelProto): + @property + def type_url(self): + return "/band.tunnel.v1beta1.MsgWithdrawFromTunnel" + + @property + def legacy_url(self): + return "tunnel/MsgWithdrawFromTunnel" diff --git a/pyband/messages/base.py b/pyband/messages/base.py index e3963ae..2eeb77a 100644 --- a/pyband/messages/base.py +++ b/pyband/messages/base.py @@ -18,4 +18,7 @@ def to_data(self): return {"@type": self.type_url} | self.to_dict(include_default_values=True) def to_legacy_codec(self): - return {"type": self.legacy_url, "value": self.to_dict(include_default_values=True, casing=Casing.SNAKE)} + return { + "type": self.legacy_url, + "value": self.to_dict(include_default_values=False, casing=Casing.SNAKE), + } diff --git a/pyband/messages/cosmos/bank/v1beta1/msgs.py b/pyband/messages/cosmos/bank/v1beta1/msgs.py index c020372..8681947 100644 --- a/pyband/messages/cosmos/bank/v1beta1/msgs.py +++ b/pyband/messages/cosmos/bank/v1beta1/msgs.py @@ -1,5 +1,3 @@ -from dataclasses import dataclass - from ....base import BaseMessageWrapper from .....proto.cosmos.bank.v1beta1 import MsgMultiSend as MsgMultiSendProto from .....proto.cosmos.bank.v1beta1 import MsgSend as MsgSendProto diff --git a/pyband/messages/cosmos/distribution/v1beta1/msgs.py b/pyband/messages/cosmos/distribution/v1beta1/msgs.py index 6c35620..21d15cd 100644 --- a/pyband/messages/cosmos/distribution/v1beta1/msgs.py +++ b/pyband/messages/cosmos/distribution/v1beta1/msgs.py @@ -1,9 +1,9 @@ -from dataclasses import dataclass - from ....base import BaseMessageWrapper from .....proto.cosmos.base import v1beta1 as __base_v1_beta1__ from .....proto.cosmos.base.query import v1beta1 as __base_query_v1_beta1__ -from .....proto.cosmos.distribution.v1beta1 import MsgWithdrawDelegatorReward as MsgWithdrawDelegatorRewardProto +from .....proto.cosmos.distribution.v1beta1 import ( + MsgWithdrawDelegatorReward as MsgWithdrawDelegatorRewardProto, +) assert __base_v1_beta1__ assert __base_query_v1_beta1__ diff --git a/pyband/messages/cosmos/gov/v1beta1/msgs.py b/pyband/messages/cosmos/gov/v1beta1/msgs.py index 717f23b..c4105cc 100644 --- a/pyband/messages/cosmos/gov/v1beta1/msgs.py +++ b/pyband/messages/cosmos/gov/v1beta1/msgs.py @@ -1,5 +1,3 @@ -from dataclasses import dataclass - from ....base import BaseMessageWrapper from .....proto.cosmos.base import v1beta1 as __base_v1_beta1__ from .....proto.cosmos.base.query import v1beta1 as __base_query_v1_beta1__ diff --git a/pyband/messages/cosmos/staking/v1beta1/msgs.py b/pyband/messages/cosmos/staking/v1beta1/msgs.py index a9d40ae..08df028 100644 --- a/pyband/messages/cosmos/staking/v1beta1/msgs.py +++ b/pyband/messages/cosmos/staking/v1beta1/msgs.py @@ -1,9 +1,9 @@ -from dataclasses import dataclass - from ....base import BaseMessageWrapper from .....proto.cosmos.base import v1beta1 as __base_v1_beta1__ from .....proto.cosmos.base.query import v1beta1 as __base_query_v1_beta1__ -from .....proto.cosmos.staking.v1beta1 import MsgBeginRedelegate as MsgBeginRedelegateProto +from .....proto.cosmos.staking.v1beta1 import ( + MsgBeginRedelegate as MsgBeginRedelegateProto, +) from .....proto.cosmos.staking.v1beta1 import MsgDelegate as MsgDelegateProto from .....proto.cosmos.staking.v1beta1 import MsgUndelegate as MsgUndelegateProto from .....proto.tendermint import types as ___tendermint_types__ diff --git a/pyband/proto/amino/__init__.py b/pyband/proto/amino/__init__.py new file mode 100644 index 0000000..a879ad4 --- /dev/null +++ b/pyband/proto/amino/__init__.py @@ -0,0 +1,8 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: amino/amino.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto diff --git a/pyband/proto/band/__init__.py b/pyband/proto/band/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/bandtss/__init__.py b/pyband/proto/band/bandtss/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/bandtss/v1beta1/__init__.py b/pyband/proto/band/bandtss/v1beta1/__init__.py new file mode 100644 index 0000000..9478f48 --- /dev/null +++ b/pyband/proto/band/bandtss/v1beta1/__init__.py @@ -0,0 +1,1068 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/bandtss/v1beta1/bandtss.proto, band/bandtss/v1beta1/genesis.proto, band/bandtss/v1beta1/query.proto, band/bandtss/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +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 ....cosmos.base import v1beta1 as __cosmos_base_v1_beta1__ +from ....cosmos.base.query import v1beta1 as __cosmos_base_query_v1_beta1__ +from ...tss import v1beta1 as __tss_v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +class TransitionStatus(betterproto.Enum): + """ + TransitionStatus is an enumeration of the possible statuses of a group transition process. + """ + + UNSPECIFIED = 0 + """ + TRANSITION_STATUS_UNSPECIFIED is the status of a group transition that has not been specified. + """ + + CREATING_GROUP = 1 + """ + TRANSITION_STATUS_CREATING_GROUP is the status of a group transition that a new group + is being created. + """ + + WAITING_SIGN = 2 + """ + TRANSITION_STATUS_WAITING_SIGN is the status of a group transition that waits members in + a current group to sign the transition message. + """ + + WAITING_EXECUTION = 3 + """ + TRANSITION_STATUS_WAITING_EXECUTION is the status of a group transition that + a transition process is completed, either from a forceTransition or having a current-group + signature on a transition message, but waits for the execution time. + """ + + +class MemberStatusFilter(betterproto.Enum): + """ + MemberStatusFilter defines the query options for filtering members by their active status. + """ + + UNSPECIFIED = 0 + """ + MEMBER_STATUS_FILTER_UNSPECIFIED defines a filter for unspecified active status. + """ + + ACTIVE = 1 + """MEMBER_STATUS_FILTER_ACTIVE defines a filter for active status.""" + + INACTIVE = 2 + """MEMBER_STATUS_FILTER_INACTIVE defines a filter for inactive status.""" + + +@dataclass(eq=False, repr=False) +class Member(betterproto.Message): + """ + Member maintains member information for monitoring their liveness activity. + """ + + address: str = betterproto.string_field(1) + """address is the address of the member.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the group ID that the member belongs to.""" + + is_active: bool = betterproto.bool_field(3) + """is_active is a flag to indicate whether a member is active or not.""" + + since: datetime = betterproto.message_field(4) + """ + since is a block timestamp when a member status is changed (from active to inactive or vice versa). + """ + + +@dataclass(eq=False, repr=False) +class CurrentGroup(betterproto.Message): + """CuurentGroup is a bandtss current group information.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is the ID of the current group.""" + + active_time: datetime = betterproto.message_field(2) + """ + active_time is the timestamp at which the group becomes the current group of the module. + """ + + +@dataclass(eq=False, repr=False) +class Signing(betterproto.Message): + """Signing is a bandtss signing information.""" + + id: int = betterproto.uint64_field(1) + """id is the unique identifier of the bandtss signing.""" + + fee_per_signer: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """ + fee_per_signer is the tokens that will be paid per signer for this bandtss signing. + """ + + requester: str = betterproto.string_field(3) + """requester is the address who pays the Bandtss signing.""" + + current_group_signing_id: int = betterproto.uint64_field(4) + """current_group_signing_id is a tss signing ID of a current group.""" + + incoming_group_signing_id: int = betterproto.uint64_field(5) + """ + incoming_group_signing_id is a tss signing ID of an incoming group, if any. + """ + + +@dataclass(eq=False, repr=False) +class GroupTransition(betterproto.Message): + """ + GroupTransition defines the group transition information of the current group and incoming group. + """ + + signing_id: int = betterproto.uint64_field(1) + """signing_id is a tss signing ID of group transition signing request.""" + + current_group_id: int = betterproto.uint64_field(2) + """current_group_id is the ID of the group that will be replaced.""" + + current_group_pub_key: bytes = betterproto.bytes_field(3) + """ + current_group_pub_key is the public key pair that used for sign & verify transition group msg. + """ + + incoming_group_id: int = betterproto.uint64_field(4) + """new_group_id is the ID of the new group that be a new key candidate.""" + + incoming_group_pub_key: bytes = betterproto.bytes_field(5) + """ + incoming_group_pub_key is the public key of the group that will be the next key of this group + """ + + status: "TransitionStatus" = betterproto.enum_field(6) + """ + status is an enumeration of the possible statuses of a group transition process. + """ + + exec_time: datetime = betterproto.message_field(7) + """exec_time is the time when the transition will be executed.""" + + is_force_transition: bool = betterproto.bool_field(8) + """ + is_force_transition is a flag to indicate whether the current group signs the transition message + before the transition is executed or not. + """ + + +@dataclass(eq=False, repr=False) +class GroupTransitionSignatureOrder(betterproto.Message): + """ + GroupTransitionSignatureOrder defines a general signature order for group transition. + """ + + pub_key: bytes = betterproto.bytes_field(1) + """ + pub_key is the public key of new group that the current group needs to be signed. + """ + + transition_time: datetime = betterproto.message_field(2) + """ + transition_time is the timestamp at which the transition is executed and the public key is active. + """ + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the bandtss module's genesis state.""" + + params: "Params" = betterproto.message_field(1) + """params defines all the paramiters of the module.""" + + members: List["Member"] = betterproto.message_field(2) + """members is an array containing members information.""" + + current_group: "CurrentGroup" = betterproto.message_field(3) + """current_group is the current group information.""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the set of module parameters.""" + + reward_percentage: int = betterproto.uint64_field(1) + """ + reward_percentage is the percentage of block rewards allocated to active TSS members. + The reward proportion is calculated after being allocated to oracle rewards. + """ + + inactive_penalty_duration: timedelta = betterproto.message_field(2) + """ + inactive_penalty_duration is the duration where a member cannot activate back after being set to inactive. + """ + + min_transition_duration: timedelta = betterproto.message_field(3) + """ + min_transition_duration is the minimum duration that the transition process waits before execution. + """ + + max_transition_duration: timedelta = betterproto.message_field(4) + """ + max_transition_duration is the maximum duration that the transition process waits before execution. + """ + + fee_per_signer: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(5) + """fee_per_signer is the tokens that will be paid per signer.""" + + +@dataclass(eq=False, repr=False) +class MsgRequestSignature(betterproto.Message): + """ + MsgRequestSignature is a request message used for initiating the signing process. + """ + + content: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) + """content is the signature order of this request signature message.""" + + memo: str = betterproto.string_field(2) + """memo is the additional note of the message.""" + + fee_limit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(3) + """fee_limit is the maximum tokens that will be paid for this request.""" + + sender: str = betterproto.string_field(4) + """sender is the requester of the signing process.""" + + +@dataclass(eq=False, repr=False) +class MsgRequestSignatureResponse(betterproto.Message): + """ + MsgRequestSignatureResponse is response data for MsgRequestSignature message + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgActivate(betterproto.Message): + """MsgActivate is a message used to activate the status of the sender.""" + + sender: str = betterproto.string_field(1) + """ + address is the signer of this message, who must be a member of the group. + """ + + group_id: int = betterproto.uint64_field(2) + """group_id is the group id of the member.""" + + +@dataclass(eq=False, repr=False) +class MsgActivateResponse(betterproto.Message): + """MsgActivateResponse is response data for MsgActivate message""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the Msg/UpdateParams request type.""" + + params: "Params" = betterproto.message_field(1) + """params defines the x/tss parameters to update.""" + + authority: str = betterproto.string_field(2) + """ + authority is the address that controls the module (defaults to x/gov unless overwritten). + """ + + +@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 MsgTransitionGroup(betterproto.Message): + """MsgTransitionGroup is the Msg/TransitionGroup request type.""" + + members: List[str] = betterproto.string_field(1) + """members is a list of members in this group.""" + + threshold: int = betterproto.uint64_field(2) + """ + threshold is a minimum number of members required to produce a signature. + """ + + exec_time: datetime = betterproto.message_field(3) + """ + exec_time is the time that will be substituted in place of the group. + """ + + authority: str = betterproto.string_field(4) + """ + authority is the address that controls the module (defaults to x/gov unless overwritten). + """ + + +@dataclass(eq=False, repr=False) +class MsgTransitionGroupResponse(betterproto.Message): + """MsgTransitionGroupResponse is the Msg/TransitionGroup response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgForceTransitionGroup(betterproto.Message): + """ + MsgForceTransitionGroup is the Msg/ForceTransitionGroup request type. + """ + + incoming_group_id: int = betterproto.uint64_field(1) + """ + incoming_group_id is the ID of the group that the module want to transition to. + """ + + exec_time: datetime = betterproto.message_field(2) + """ + exec_time is the time that will be substituted in place of the group. + """ + + authority: str = betterproto.string_field(3) + """ + authority is the address that controls the module (defaults to x/gov unless overwritten). + """ + + +@dataclass(eq=False, repr=False) +class MsgForceTransitionGroupResponse(betterproto.Message): + """ + MsgForceTransitionGroupResponse is the Msg/ForceTransitionGroup response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryCountsRequest(betterproto.Message): + """QueryCountsRequest is request type for the Query/Count RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class QueryCountsResponse(betterproto.Message): + """QueryCountsResponse is response type for the Query/Count RPC method.""" + + signing_count: int = betterproto.uint64_field(1) + """ + signing_count is total number of signing request submitted to bandtss module + """ + + +@dataclass(eq=False, repr=False) +class QueryMembersRequest(betterproto.Message): + """ + QueryMembersRequest is the request type for the Query/Members RPC method. + """ + + status: "MemberStatusFilter" = betterproto.enum_field(1) + """status define type of filter on member's status.""" + + is_incoming_group: bool = betterproto.bool_field(2) + """ + is_incoming_group is a flag to indicate whether user query members in the incoming group + or the current group. + """ + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(3) + ) + """pagination defines pagination settings for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryMembersResponse(betterproto.Message): + """ + QueryMembersResponse is the response type for the Query/Members RPC method. + """ + + members: List["Member"] = betterproto.message_field(1) + """ + members are those individuals who correspond to the provided is_active status. + """ + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryMemberRequest(betterproto.Message): + """ + QueryMemberRequest is the request type for the Query/Member RPC method. + """ + + address: str = betterproto.string_field(1) + """address is the member address.""" + + +@dataclass(eq=False, repr=False) +class QueryMemberResponse(betterproto.Message): + """ + QueryMemberResponse is the response type for the Query/Member RPC method. + """ + + current_group_member: "Member" = betterproto.message_field(1) + """current_group_member is the member detail.""" + + incoming_group_member: "Member" = betterproto.message_field(2) + """incoming_group_member is the member detail.""" + + +@dataclass(eq=False, repr=False) +class QueryCurrentGroupRequest(betterproto.Message): + """ + QueryCurrentGroupRequest is the request type for the Query/CurrentGroup RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryCurrentGroupResponse(betterproto.Message): + """ + QueryCurrentGroupResponse is the response type for the Query/CurrentGroup RPC method. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is the ID of the current group.""" + + size: int = betterproto.uint64_field(2) + """size is the number of members in the group.""" + + threshold: int = betterproto.uint64_field(3) + """ + threshold is the minimum number of members needed to generate a valid signature. + """ + + pub_key: bytes = betterproto.bytes_field(4) + """pub_key is the public key generated by the group.""" + + status: "__tss_v1_beta1__.GroupStatus" = betterproto.enum_field(5) + """status is the status of the current group.""" + + active_time: datetime = betterproto.message_field(6) + """ + active_time is the timestamp at which the group becomes the current group of the module. + """ + + +@dataclass(eq=False, repr=False) +class QueryIncomingGroupRequest(betterproto.Message): + """ + QueryIncomingGroupRequest is the request type for the Query/IncomingGroup RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryIncomingGroupResponse(betterproto.Message): + """ + QueryIncomingGroupResponse is the response type for the Query/IncomingGroup RPC method. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is the ID of the incoming group.""" + + size: int = betterproto.uint64_field(2) + """size is the number of members in the group.""" + + threshold: int = betterproto.uint64_field(3) + """ + threshold is the minimum number of members needed to generate a valid signature. + """ + + pub_key: bytes = betterproto.bytes_field(4) + """pub_key is the public key generated by the group.""" + + status: "__tss_v1_beta1__.GroupStatus" = betterproto.enum_field(5) + """status is the status of the incoming group.""" + + +@dataclass(eq=False, repr=False) +class QuerySigningRequest(betterproto.Message): + """ + QuerySingingRequest is the request type for the Query/Signing RPC method. + """ + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the ID of the signing request.""" + + +@dataclass(eq=False, repr=False) +class QuerySigningResponse(betterproto.Message): + """ + QuerySigningResponse is the response type for the Query/Signing RPC method. + """ + + fee_per_signer: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """ + fee_per_signer is the tokens that will be paid per signer for this bandtss signing. + """ + + requester: str = betterproto.string_field(2) + """requester is the address of requester who paid for bandtss signing.""" + + current_group_signing_result: "__tss_v1_beta1__.SigningResult" = ( + betterproto.message_field(3) + ) + """ + current_group_signing_result is the signing result from the current group. + """ + + incoming_group_signing_result: "__tss_v1_beta1__.SigningResult" = ( + betterproto.message_field(4) + ) + """ + incoming_group_signing_result is the signing result from the incoming group. + """ + + +@dataclass(eq=False, repr=False) +class QueryGroupTransitionRequest(betterproto.Message): + """ + QueryGroupTransitionRequest is the request type for the Query/GroupTransition RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryGroupTransitionResponse(betterproto.Message): + """ + QueryGroupTransitionResponse is the response type for the Query/GroupTransition RPC method. + """ + + group_transition: "GroupTransition" = betterproto.message_field(1) + """group_transition is the group transition information.""" + + +@dataclass(eq=False, repr=False) +class QueryParamsRequest(betterproto.Message): + """QueryParamsRequest is request type for the Query/Params RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class QueryParamsResponse(betterproto.Message): + """ + QueryParamsResponse is response type for the Query/Params RPC method. + """ + + params: "Params" = betterproto.message_field(1) + """Params is the parameters of the module.""" + + +class MsgStub(betterproto.ServiceStub): + async def request_signature( + self, + msg_request_signature: "MsgRequestSignature", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgRequestSignatureResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Msg/RequestSignature", + msg_request_signature, + MsgRequestSignatureResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def activate( + self, + msg_activate: "MsgActivate", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgActivateResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Msg/Activate", + msg_activate, + MsgActivateResponse, + 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( + "/band.bandtss.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def transition_group( + self, + msg_transition_group: "MsgTransitionGroup", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgTransitionGroupResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Msg/TransitionGroup", + msg_transition_group, + MsgTransitionGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def force_transition_group( + self, + msg_force_transition_group: "MsgForceTransitionGroup", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgForceTransitionGroupResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Msg/ForceTransitionGroup", + msg_force_transition_group, + MsgForceTransitionGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def counts( + self, + query_counts_request: "QueryCountsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryCountsResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/Counts", + query_counts_request, + QueryCountsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def members( + self, + query_members_request: "QueryMembersRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryMembersResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/Members", + query_members_request, + QueryMembersResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def member( + self, + query_member_request: "QueryMemberRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryMemberResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/Member", + query_member_request, + QueryMemberResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def current_group( + self, + query_current_group_request: "QueryCurrentGroupRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryCurrentGroupResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/CurrentGroup", + query_current_group_request, + QueryCurrentGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def incoming_group( + self, + query_incoming_group_request: "QueryIncomingGroupRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryIncomingGroupResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/IncomingGroup", + query_incoming_group_request, + QueryIncomingGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def signing( + self, + query_signing_request: "QuerySigningRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySigningResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/Signing", + query_signing_request, + QuerySigningResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def group_transition( + self, + query_group_transition_request: "QueryGroupTransitionRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupTransitionResponse": + return await self._unary_unary( + "/band.bandtss.v1beta1.Query/GroupTransition", + query_group_transition_request, + QueryGroupTransitionResponse, + 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( + "/band.bandtss.v1beta1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def request_signature( + self, msg_request_signature: "MsgRequestSignature" + ) -> "MsgRequestSignatureResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def activate(self, msg_activate: "MsgActivate") -> "MsgActivateResponse": + 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 transition_group( + self, msg_transition_group: "MsgTransitionGroup" + ) -> "MsgTransitionGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def force_transition_group( + self, msg_force_transition_group: "MsgForceTransitionGroup" + ) -> "MsgForceTransitionGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_request_signature( + self, + stream: "grpclib.server.Stream[MsgRequestSignature, MsgRequestSignatureResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.request_signature(request) + await stream.send_message(response) + + async def __rpc_activate( + self, stream: "grpclib.server.Stream[MsgActivate, MsgActivateResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.activate(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_transition_group( + self, + stream: "grpclib.server.Stream[MsgTransitionGroup, MsgTransitionGroupResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.transition_group(request) + await stream.send_message(response) + + async def __rpc_force_transition_group( + self, + stream: "grpclib.server.Stream[MsgForceTransitionGroup, MsgForceTransitionGroupResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.force_transition_group(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.bandtss.v1beta1.Msg/RequestSignature": grpclib.const.Handler( + self.__rpc_request_signature, + grpclib.const.Cardinality.UNARY_UNARY, + MsgRequestSignature, + MsgRequestSignatureResponse, + ), + "/band.bandtss.v1beta1.Msg/Activate": grpclib.const.Handler( + self.__rpc_activate, + grpclib.const.Cardinality.UNARY_UNARY, + MsgActivate, + MsgActivateResponse, + ), + "/band.bandtss.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + "/band.bandtss.v1beta1.Msg/TransitionGroup": grpclib.const.Handler( + self.__rpc_transition_group, + grpclib.const.Cardinality.UNARY_UNARY, + MsgTransitionGroup, + MsgTransitionGroupResponse, + ), + "/band.bandtss.v1beta1.Msg/ForceTransitionGroup": grpclib.const.Handler( + self.__rpc_force_transition_group, + grpclib.const.Cardinality.UNARY_UNARY, + MsgForceTransitionGroup, + MsgForceTransitionGroupResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def counts( + self, query_counts_request: "QueryCountsRequest" + ) -> "QueryCountsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def members( + self, query_members_request: "QueryMembersRequest" + ) -> "QueryMembersResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def member( + self, query_member_request: "QueryMemberRequest" + ) -> "QueryMemberResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def current_group( + self, query_current_group_request: "QueryCurrentGroupRequest" + ) -> "QueryCurrentGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def incoming_group( + self, query_incoming_group_request: "QueryIncomingGroupRequest" + ) -> "QueryIncomingGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def signing( + self, query_signing_request: "QuerySigningRequest" + ) -> "QuerySigningResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def group_transition( + self, query_group_transition_request: "QueryGroupTransitionRequest" + ) -> "QueryGroupTransitionResponse": + 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_counts( + self, stream: "grpclib.server.Stream[QueryCountsRequest, QueryCountsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.counts(request) + await stream.send_message(response) + + async def __rpc_members( + self, stream: "grpclib.server.Stream[QueryMembersRequest, QueryMembersResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.members(request) + await stream.send_message(response) + + async def __rpc_member( + self, stream: "grpclib.server.Stream[QueryMemberRequest, QueryMemberResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.member(request) + await stream.send_message(response) + + async def __rpc_current_group( + self, + stream: "grpclib.server.Stream[QueryCurrentGroupRequest, QueryCurrentGroupResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.current_group(request) + await stream.send_message(response) + + async def __rpc_incoming_group( + self, + stream: "grpclib.server.Stream[QueryIncomingGroupRequest, QueryIncomingGroupResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.incoming_group(request) + await stream.send_message(response) + + async def __rpc_signing( + self, stream: "grpclib.server.Stream[QuerySigningRequest, QuerySigningResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.signing(request) + await stream.send_message(response) + + async def __rpc_group_transition( + self, + stream: "grpclib.server.Stream[QueryGroupTransitionRequest, QueryGroupTransitionResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.group_transition(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) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.bandtss.v1beta1.Query/Counts": grpclib.const.Handler( + self.__rpc_counts, + grpclib.const.Cardinality.UNARY_UNARY, + QueryCountsRequest, + QueryCountsResponse, + ), + "/band.bandtss.v1beta1.Query/Members": grpclib.const.Handler( + self.__rpc_members, + grpclib.const.Cardinality.UNARY_UNARY, + QueryMembersRequest, + QueryMembersResponse, + ), + "/band.bandtss.v1beta1.Query/Member": grpclib.const.Handler( + self.__rpc_member, + grpclib.const.Cardinality.UNARY_UNARY, + QueryMemberRequest, + QueryMemberResponse, + ), + "/band.bandtss.v1beta1.Query/CurrentGroup": grpclib.const.Handler( + self.__rpc_current_group, + grpclib.const.Cardinality.UNARY_UNARY, + QueryCurrentGroupRequest, + QueryCurrentGroupResponse, + ), + "/band.bandtss.v1beta1.Query/IncomingGroup": grpclib.const.Handler( + self.__rpc_incoming_group, + grpclib.const.Cardinality.UNARY_UNARY, + QueryIncomingGroupRequest, + QueryIncomingGroupResponse, + ), + "/band.bandtss.v1beta1.Query/Signing": grpclib.const.Handler( + self.__rpc_signing, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySigningRequest, + QuerySigningResponse, + ), + "/band.bandtss.v1beta1.Query/GroupTransition": grpclib.const.Handler( + self.__rpc_group_transition, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupTransitionRequest, + QueryGroupTransitionResponse, + ), + "/band.bandtss.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/pyband/proto/band/base/__init__.py b/pyband/proto/band/base/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/base/node/__init__.py b/pyband/proto/band/base/node/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/base/node/v1/__init__.py b/pyband/proto/band/base/node/v1/__init__.py new file mode 100644 index 0000000..08f3ef1 --- /dev/null +++ b/pyband/proto/band/base/node/v1/__init__.py @@ -0,0 +1,146 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/base/node/v1beta1/query.proto +# plugin: python-betterproto +# This file has been @generated + +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 ChainIdRequest(betterproto.Message): + """ChainIDRequest is request type for the Service/ChainID RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class ChainIdResponse(betterproto.Message): + """ChainIDResponse is response type for the Service/ChainID RPC method.""" + + chain_id: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class EvmValidatorsRequest(betterproto.Message): + """ + EVMValidatorsRequest is request type for the Service/EVMValidators RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class EvmValidatorsResponse(betterproto.Message): + """ + EVMValidatorsResponse is response type for the Service/EVMValidators RPC method. + """ + + block_height: int = betterproto.int64_field(1) + """BlockHeight is the latest block height""" + + validators: List["ValidatorMinimal"] = betterproto.message_field(2) + """Validators is list of validator's addresss and voting power""" + + +@dataclass(eq=False, repr=False) +class ValidatorMinimal(betterproto.Message): + """ + ValidatorMinimal is the data structure for storing validator's address and voting power + """ + + address: str = betterproto.string_field(1) + voting_power: int = betterproto.int64_field(2) + + +class ServiceStub(betterproto.ServiceStub): + async def chain_id( + self, + chain_id_request: "ChainIdRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ChainIdResponse": + return await self._unary_unary( + "/band.base.node.v1beta1.Service/ChainID", + chain_id_request, + ChainIdResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def evm_validators( + self, + evm_validators_request: "EvmValidatorsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "EvmValidatorsResponse": + return await self._unary_unary( + "/band.base.node.v1beta1.Service/EVMValidators", + evm_validators_request, + EvmValidatorsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class ServiceBase(ServiceBase): + + async def chain_id(self, chain_id_request: "ChainIdRequest") -> "ChainIdResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def evm_validators( + self, evm_validators_request: "EvmValidatorsRequest" + ) -> "EvmValidatorsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_chain_id( + self, stream: "grpclib.server.Stream[ChainIdRequest, ChainIdResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.chain_id(request) + await stream.send_message(response) + + async def __rpc_evm_validators( + self, + stream: "grpclib.server.Stream[EvmValidatorsRequest, EvmValidatorsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.evm_validators(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.base.node.v1beta1.Service/ChainID": grpclib.const.Handler( + self.__rpc_chain_id, + grpclib.const.Cardinality.UNARY_UNARY, + ChainIdRequest, + ChainIdResponse, + ), + "/band.base.node.v1beta1.Service/EVMValidators": grpclib.const.Handler( + self.__rpc_evm_validators, + grpclib.const.Cardinality.UNARY_UNARY, + EvmValidatorsRequest, + EvmValidatorsResponse, + ), + } diff --git a/pyband/proto/band/base/oracle/__init__.py b/pyband/proto/band/base/oracle/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/base/oracle/v1/__init__.py b/pyband/proto/band/base/oracle/v1/__init__.py new file mode 100644 index 0000000..76ef21f --- /dev/null +++ b/pyband/proto/band/base/oracle/v1/__init__.py @@ -0,0 +1,400 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/base/oracle/v1beta1/proof.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from ....oracle import v1 as __oracle_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 ProofRequest(betterproto.Message): + """ProofRequest is request type for the Service/Proof RPC method.""" + + request_id: int = betterproto.uint64_field(1) + """RequestID is ID of an oracle request""" + + height: int = betterproto.int64_field(2) + """height is block height""" + + +@dataclass(eq=False, repr=False) +class ProofResponse(betterproto.Message): + """ProofResponse is response type for the Service/Proof RPC method.""" + + height: int = betterproto.int64_field(1) + """height is block height""" + + result: "SingleProofResult" = betterproto.message_field(2) + """result is the proof""" + + +@dataclass(eq=False, repr=False) +class MultiProofRequest(betterproto.Message): + """ + MultiProofRequest is request type for the Service/MultiProof RPC method. + """ + + request_ids: List[int] = betterproto.uint64_field(1) + """request_ids is the list of request IDs""" + + +@dataclass(eq=False, repr=False) +class MultiProofResponse(betterproto.Message): + """ + MultiProofResponse is response type for the Service/MultiProof RPC method. + """ + + height: int = betterproto.int64_field(1) + result: "MultiProofResult" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class RequestCountProofRequest(betterproto.Message): + """ + RequestCountProofRequest is request type for the Service/RequestCountProof RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class RequestCountProofResponse(betterproto.Message): + """ + RequestCountProofResponse is response type for the Service/RequestCountProof RPC method. + """ + + height: int = betterproto.int64_field(1) + result: "CountProofResult" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class SingleProofResult(betterproto.Message): + """ + SingleProofResponse is the data structure for response of single proof + """ + + proof: "SingleProof" = betterproto.message_field(1) + evm_proof_bytes: bytes = betterproto.bytes_field(2) + + +@dataclass(eq=False, repr=False) +class MultiProofResult(betterproto.Message): + """MultiProofResult is the data structure for response of multi proof""" + + proof: "MultiProof" = betterproto.message_field(1) + evm_proof_bytes: bytes = betterproto.bytes_field(2) + + +@dataclass(eq=False, repr=False) +class CountProofResult(betterproto.Message): + """CountProofResult is the data structure for response of count proof""" + + proof: "CountProof" = betterproto.message_field(1) + evm_proof_bytes: bytes = betterproto.bytes_field(2) + + +@dataclass(eq=False, repr=False) +class SingleProof(betterproto.Message): + """ + SingleProof contains block height, oracle data proof and block relay proof + """ + + block_height: int = betterproto.uint64_field(1) + oracle_data_proof: "OracleDataProof" = betterproto.message_field(2) + block_relay_proof: "BlockRelayProof" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class MultiProof(betterproto.Message): + """ + MultiProof contains block height, list of oracle data proof and block relay proof + """ + + block_height: int = betterproto.uint64_field(1) + oracle_data_multi_proof: List["OracleDataProof"] = betterproto.message_field(2) + block_relay_proof: "BlockRelayProof" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class CountProof(betterproto.Message): + """CountProof contains block height, count proof and block relay proof""" + + block_height: int = betterproto.uint64_field(1) + count_proof: "RequestsCountProof" = betterproto.message_field(2) + block_relay_proof: "BlockRelayProof" = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class OracleDataProof(betterproto.Message): + """OracleDataProof contains result, version and merkle paths""" + + result: "__oracle_v1__.Result" = betterproto.message_field(1) + version: int = betterproto.uint64_field(2) + merkle_paths: List["IavlMerklePath"] = betterproto.message_field(3) + + +@dataclass(eq=False, repr=False) +class IavlMerklePath(betterproto.Message): + """ + IAVLMerklePath represents a Merkle step to a leaf data node in an iAVL tree. + """ + + is_data_on_right: bool = betterproto.bool_field(1) + subtree_height: int = betterproto.uint32_field(2) + subtree_size: int = betterproto.uint64_field(3) + subtree_version: int = betterproto.uint64_field(4) + sibling_hash: bytes = betterproto.bytes_field(5) + + +@dataclass(eq=False, repr=False) +class BlockRelayProof(betterproto.Message): + """ + BlockRelayProof contains multi store proof, block header merkle parts, common encoded part and signatures + """ + + multi_store_proof: "MultiStoreProof" = betterproto.message_field(1) + block_header_merkle_parts: "BlockHeaderMerkleParts" = betterproto.message_field(2) + common_encoded_vote_part: "CommonEncodedVotePart" = betterproto.message_field(3) + signatures: List["TmSignature"] = betterproto.message_field(4) + + +@dataclass(eq=False, repr=False) +class MultiStoreProof(betterproto.Message): + """ + MultiStoreProof stores a compact of other Cosmos-SDK modules' storage hash in multistore to + compute (in combination with oracle store hash) Tendermint's application state hash at a given block. + + __________________________[AppHash]__________________________ + / \ + ___________[N24]____________ ___________[N25]________ + / \ / \ + _____[N20]_____ ____[N21]______ ____[N22]______ _[N23]_ + / \ / \ / \ / \ + _[N12]_ _[N13]_ _[N14]_ _[N15]_ _[N16]_ _[N17]_ [N18] [Q] + / \ / \ / \ / \ / \ / \ / \ + [N0] [N1] [N2] [N3] [N4] [N5] [N6] [N7] [N8] [N9] [N10] [N11] [O] [P] + / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ + [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] + + [0] - acc (auth) [1] - authz [2] - bandtss [3] - bank [4] - capability [5] - consensus + [6] - crisis [7] - distribution [8] - evidence [9] - feeds [A] - feegrant [B] - feeibc + [C] - globalfee [D] - gov [E] - ibc [F] - icahost [G] - mint [H] - oracle + [I] - params [J] - restake [K] - rollingseed [L] - slashing [M] - staking [N] - transfer + [O] - tss [P] - tunnel [Q] - upgrade + + Notice that NOT all leaves of the Merkle tree are needed in order to compute the Merkle + root hash, since we only want to validate the correctness of [H] In fact, only + [G], [N9], [N17], [N23], and [N24] are needed in order to compute [AppHash]. + """ + + oracle_iavl_state_hash: bytes = betterproto.bytes_field(1) + mint_store_merkle_hash: bytes = betterproto.bytes_field(2) + params_to_restake_stores_merkle_hash: bytes = betterproto.bytes_field(3) + rollingseed_to_transfer_stores_merkle_hash: bytes = betterproto.bytes_field(4) + tss_to_upgrade_stores_merkle_hash: bytes = betterproto.bytes_field(5) + auth_to_icahost_stores_merkle_hash: bytes = betterproto.bytes_field(6) + + +@dataclass(eq=False, repr=False) +class BlockHeaderMerkleParts(betterproto.Message): + """ + BlockHeaderMerkleParts stores a group of hashes using for computing Tendermint's block + header hash from app hash, and height. + + In Tendermint, a block header hash is the Merkle hash of a binary tree with 14 leaf nodes. + Each node encodes a data piece of the blockchain. The notable data leaves are: [A] app_hash, + [2] height. All data pieces are combined into one 32-byte hash to be signed + by block validators. The structure of the Merkle tree is shown below. + + [BlockHeader] + / \ + [3A] [3B] + / \ / \ + [2A] [2B] [2C] [2D] + / \ / \ / \ / \ + [1A] [1B] [1C] [1D] [1E] [1F] [C] [D] + / \ / \ / \ / \ / \ / \ + [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [A] [B] + + [0] - version [1] - chain_id [2] - height [3] - time + [4] - last_block_id [5] - last_commit_hash [6] - data_hash [7] - validators_hash + [8] - next_validators_hash [9] - consensus_hash [A] - app_hash [B] - last_results_hash + [C] - evidence_hash [D] - proposer_address + + Notice that NOT all leaves of the Merkle tree are needed in order to compute the Merkle + root hash, since we only want to validate the correctness of [2], [3], and [A]. In fact, only + [1A], [2B], [1E], [B], and [2D] are needed in order to compute [BlockHeader]. + """ + + version_and_chain_id_hash: bytes = betterproto.bytes_field(1) + height: int = betterproto.uint64_field(2) + time_second: int = betterproto.uint64_field(3) + time_nano_second: int = betterproto.uint32_field(4) + last_block_id_and_other: bytes = betterproto.bytes_field(5) + next_validator_hash_and_consensus_hash: bytes = betterproto.bytes_field(6) + last_results_hash: bytes = betterproto.bytes_field(7) + evidence_and_proposer_hash: bytes = betterproto.bytes_field(8) + + +@dataclass(eq=False, repr=False) +class CommonEncodedVotePart(betterproto.Message): + """CommonEncodedVotePart represents the common part of encoded vote""" + + signed_data_prefix: bytes = betterproto.bytes_field(1) + signed_data_suffix: bytes = betterproto.bytes_field(2) + + +@dataclass(eq=False, repr=False) +class TmSignature(betterproto.Message): + """ + TMSignature contains all details of validator signature for performing signer recovery for ECDSA + secp256k1 signature. Note that this struct is written specifically for signature signed on + Tendermint's precommit data, which includes the block hash and some additional information prepended + and appended to the block hash. The prepended part (prefix) and the appended part (suffix) are + different for each signer (including signature size, machine clock, validator index, etc). + """ + + r: bytes = betterproto.bytes_field(1) + s: bytes = betterproto.bytes_field(2) + v: int = betterproto.uint32_field(3) + encoded_timestamp: bytes = betterproto.bytes_field(4) + + +@dataclass(eq=False, repr=False) +class RequestsCountProof(betterproto.Message): + """RequestsCountProof contains count, version and merkle paths""" + + count: int = betterproto.uint64_field(1) + version: int = betterproto.uint64_field(2) + merkle_paths: List["IavlMerklePath"] = betterproto.message_field(3) + + +class ServiceStub(betterproto.ServiceStub): + async def proof( + self, + proof_request: "ProofRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ProofResponse": + return await self._unary_unary( + "/band.base.oracle.v1beta1.Service/Proof", + proof_request, + ProofResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def multi_proof( + self, + multi_proof_request: "MultiProofRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MultiProofResponse": + return await self._unary_unary( + "/band.base.oracle.v1beta1.Service/MultiProof", + multi_proof_request, + MultiProofResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def request_count_proof( + self, + request_count_proof_request: "RequestCountProofRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "RequestCountProofResponse": + return await self._unary_unary( + "/band.base.oracle.v1beta1.Service/RequestCountProof", + request_count_proof_request, + RequestCountProofResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class ServiceBase(ServiceBase): + + async def proof(self, proof_request: "ProofRequest") -> "ProofResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def multi_proof( + self, multi_proof_request: "MultiProofRequest" + ) -> "MultiProofResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def request_count_proof( + self, request_count_proof_request: "RequestCountProofRequest" + ) -> "RequestCountProofResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_proof( + self, stream: "grpclib.server.Stream[ProofRequest, ProofResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.proof(request) + await stream.send_message(response) + + async def __rpc_multi_proof( + self, stream: "grpclib.server.Stream[MultiProofRequest, MultiProofResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.multi_proof(request) + await stream.send_message(response) + + async def __rpc_request_count_proof( + self, + stream: "grpclib.server.Stream[RequestCountProofRequest, RequestCountProofResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.request_count_proof(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.base.oracle.v1beta1.Service/Proof": grpclib.const.Handler( + self.__rpc_proof, + grpclib.const.Cardinality.UNARY_UNARY, + ProofRequest, + ProofResponse, + ), + "/band.base.oracle.v1beta1.Service/MultiProof": grpclib.const.Handler( + self.__rpc_multi_proof, + grpclib.const.Cardinality.UNARY_UNARY, + MultiProofRequest, + MultiProofResponse, + ), + "/band.base.oracle.v1beta1.Service/RequestCountProof": grpclib.const.Handler( + self.__rpc_request_count_proof, + grpclib.const.Cardinality.UNARY_UNARY, + RequestCountProofRequest, + RequestCountProofResponse, + ), + } diff --git a/pyband/proto/band/feeds/__init__.py b/pyband/proto/band/feeds/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/feeds/v1beta1/__init__.py b/pyband/proto/band/feeds/v1beta1/__init__.py new file mode 100644 index 0000000..6f65daf --- /dev/null +++ b/pyband/proto/band/feeds/v1beta1/__init__.py @@ -0,0 +1,1255 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/feeds/v1beta1/encoder.proto, band/feeds/v1beta1/feeds.proto, band/feeds/v1beta1/genesis.proto, band/feeds/v1beta1/params.proto, band/feeds/v1beta1/query.proto, band/feeds/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +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.query import v1beta1 as __cosmos_base_query_v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +class Encoder(betterproto.Enum): + """ + Encoder is an enumerator that defines the mode of encoding message in tss module. + """ + + UNSPECIFIED = 0 + """ENCODER_UNSPECIFIED is an unspecified encoder mode.""" + + FIXED_POINT_ABI = 1 + """ + ENCODER_FIXED_POINT_ABI is a fixed-point price abi encoder (price * 10^9). + """ + + TICK_ABI = 2 + """ENCODER_TICK_ABI is a tick abi encoder.""" + + +class PriceStatus(betterproto.Enum): + """PriceStatus is a structure that defines the price status of a price.""" + + UNSPECIFIED = 0 + """PRICE_STATUS_UNSPECIFIED is an unspecified price status.""" + + UNKNOWN_SIGNAL_ID = 1 + """PRICE_STATUS_UNKNOWN_SIGNAL_ID is an unknown signal id price status.""" + + NOT_READY = 2 + """PRICE_STATUS_NOT_READY is a not ready price status.""" + + AVAILABLE = 3 + """PRICE_STATUS_AVAILABLE is an available price status.""" + + NOT_IN_CURRENT_FEEDS = 4 + """ + PRICE_STATUS_NOT_IN_CURRENT_FEEDS is a not in current feed price status. + """ + + +class SignalPriceStatus(betterproto.Enum): + """ + SignalPriceStatus is a structure that defines the price status of a signal id. + """ + + UNSPECIFIED = 0 + """ + SIGNAL_PRICE_STATUS_UNSPECIFIED is an unspecified signal price status. + """ + + UNSUPPORTED = 1 + """ + SIGNAL_PRICE_STATUS_UNSUPPORTED is an unsupported signal price status. + """ + + UNAVAILABLE = 2 + """ + SIGNAL_PRICE_STATUS_UNAVAILABLE is an unavailable signal price status. + """ + + AVAILABLE = 3 + """SIGNAL_PRICE_STATUS_AVAILABLE is an available signal price status.""" + + +@dataclass(eq=False, repr=False) +class Signal(betterproto.Message): + """ + Signal is the data structure that contains signal id and power of that signal. + """ + + id: str = betterproto.string_field(1) + """id is the id of the signal.""" + + power: int = betterproto.int64_field(2) + """power is the power of the corresponding signal id.""" + + +@dataclass(eq=False, repr=False) +class Vote(betterproto.Message): + """ + Vote is the data structure that contains array of signals of a voter. + """ + + voter: str = betterproto.string_field(1) + """voter is the address of the voter of this signals.""" + + signals: List["Signal"] = betterproto.message_field(2) + """signals is a list of signals submit by the voter.""" + + +@dataclass(eq=False, repr=False) +class Feed(betterproto.Message): + """ + Feed is a structure that holds a signal id, its total power, and its calculated interval. + """ + + signal_id: str = betterproto.string_field(1) + """signal_id is the unique string that identifies the unit of feed.""" + + power: int = betterproto.int64_field(2) + """power is the power of the corresponding signal id.""" + + interval: int = betterproto.int64_field(3) + """interval is the interval of the price feed.""" + + +@dataclass(eq=False, repr=False) +class FeedWithDeviation(betterproto.Message): + """ + FeedWithDeviation is a structure that holds a signal id, its total power, and its calculated interval and deviation. + """ + + signal_id: str = betterproto.string_field(1) + """signal_id is the unique string that identifies the unit of feed.""" + + power: int = betterproto.int64_field(2) + """power is the power of the corresponding signal id.""" + + interval: int = betterproto.int64_field(3) + """interval is the interval of the price feed.""" + + deviation_basis_point: int = betterproto.int64_field(4) + """ + deviation_basis_point is the maximum deviation value the feed can tolerate, expressed in basis points. + """ + + +@dataclass(eq=False, repr=False) +class CurrentFeeds(betterproto.Message): + """ + CurrentFeeds is a structure that holds a list of currently supported feeds, and its last update time and block. + """ + + feeds: List["Feed"] = betterproto.message_field(1) + """feeds is a list of currently supported feeds.""" + + last_update_timestamp: int = betterproto.int64_field(2) + """ + last_update_timestamp is the timestamp of the last time supported feeds list is updated. + """ + + last_update_block: int = betterproto.int64_field(3) + """ + last_update_block is the number of blocks of the last time supported feeds list is updated. + """ + + +@dataclass(eq=False, repr=False) +class CurrentFeedWithDeviations(betterproto.Message): + """ + CurrentFeedWithDeviations is a structure that holds a list of currently supported feed-with-deviations, and its + last update time and block. + """ + + feeds: List["FeedWithDeviation"] = betterproto.message_field(1) + """feeds is a list of currently supported feed-with-deviations.""" + + last_update_timestamp: int = betterproto.int64_field(2) + """ + last_update_timestamp is the timestamp of the last time supported feeds list is updated. + """ + + last_update_block: int = betterproto.int64_field(3) + """ + last_update_block is the number of blocks of the last time supported feeds list is updated. + """ + + +@dataclass(eq=False, repr=False) +class Price(betterproto.Message): + """Price is a structure that defines the price of a signal id.""" + + status: "PriceStatus" = betterproto.enum_field(1) + """status is the status of a the price.""" + + signal_id: str = betterproto.string_field(2) + """signal_id is the signal id of the price.""" + + price: int = betterproto.uint64_field(3) + """price is the price of the signal id.""" + + timestamp: int = betterproto.int64_field(4) + """timestamp is the timestamp at which the price was aggregated.""" + + +@dataclass(eq=False, repr=False) +class SignalPrice(betterproto.Message): + """ + SignalPrice is a structure that defines the signaled price of a signal id. + """ + + status: "SignalPriceStatus" = betterproto.enum_field(1) + """status is the status of the signal price.""" + + signal_id: str = betterproto.string_field(2) + """signal_id is the signal id of the price.""" + + price: int = betterproto.uint64_field(3) + """price is the price submitted by the validator.""" + + +@dataclass(eq=False, repr=False) +class ValidatorPrice(betterproto.Message): + """ + ValidatorPrice is a structure that defines the price submitted by a validator for a signal id. + """ + + signal_price_status: "SignalPriceStatus" = betterproto.enum_field(1) + """signal_price_status is the status of a signal price submitted.""" + + signal_id: str = betterproto.string_field(2) + """signal_id is the signal id of the price.""" + + price: int = betterproto.uint64_field(3) + """price is the price submitted by the validator.""" + + timestamp: int = betterproto.int64_field(4) + """timestamp is the timestamp at which the price was submitted.""" + + block_height: int = betterproto.int64_field(5) + """block_height is the block height at which the price was submitted.""" + + +@dataclass(eq=False, repr=False) +class ValidatorPriceList(betterproto.Message): + """ + ValidatorPriceList is a structure that holds a list of validator prices of + a validator and its address. + """ + + validator: str = betterproto.string_field(1) + """validator is the validator address.""" + + validator_prices: List["ValidatorPrice"] = betterproto.message_field(2) + """validators_prices is a list of validator prices.""" + + +@dataclass(eq=False, repr=False) +class ReferenceSourceConfig(betterproto.Message): + """ + ReferenceSourceConfig is a structure that defines the information of reference price source. + """ + + registry_ipfs_hash: str = betterproto.string_field(1) + """registry_ipfs_hash is the hash of the reference registry.""" + + registry_version: str = betterproto.string_field(2) + """registry_version is the version of the reference registry.""" + + +@dataclass(eq=False, repr=False) +class FeedsSignatureOrder(betterproto.Message): + """FeedsSignatureOrder defines a general signature order for feed data.""" + + signal_ids: List[str] = betterproto.string_field(1) + """signal_ids is the list of signal ids that require signatures.""" + + encoder: Encoder = betterproto.enum_field(2) + """encoder is the mode of encoding feeds signature order.""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """ + Params is the data structure that keeps the parameters of the feeds module. + """ + + admin: str = betterproto.string_field(1) + """ + admin is the address of the admin that is allowed to perform operations on modules. + """ + + allowable_block_time_discrepancy: int = betterproto.int64_field(2) + """ + allowable_block_time_discrepancy is the allowed discrepancy (in seconds) between validator price timestamp and + block_time. + """ + + grace_period: int = betterproto.int64_field(3) + """ + grace_period is the time (in seconds) given for validators to adapt to changing in feed's interval. + """ + + min_interval: int = betterproto.int64_field(4) + """ + min_interval is the minimum limit of every feeds' interval (in seconds). + If the calculated interval is lower than this, it will be capped at this value. + """ + + max_interval: int = betterproto.int64_field(5) + """ + max_interval is the maximum limit of every feeds' interval (in seconds). + If the calculated interval of a feed is higher than this, it will not be capped at this value. + """ + + power_step_threshold: int = betterproto.int64_field(6) + """ + power_step_threshold is the amount of minimum power required to put feed in the current feeds list. + """ + + max_current_feeds: int = betterproto.uint64_field(7) + """ + max_current_feeds is the maximum number of feeds supported at a time. + """ + + cooldown_time: int = betterproto.int64_field(8) + """ + cooldown_time represents the duration (in seconds) during which validators are prohibited from sending new prices. + """ + + min_deviation_basis_point: int = betterproto.int64_field(9) + """ + min_deviation_basis_point is the minimum limit of every feeds' deviation (in basis point). + """ + + max_deviation_basis_point: int = betterproto.int64_field(10) + """ + max_deviation_basis_point is the maximum limit of every feeds' deviation (in basis point). + """ + + current_feeds_update_interval: int = betterproto.int64_field(11) + """ + current_feeds_update_interval is the number of blocks after which the current feeds will be re-calculated. + """ + + price_quorum: str = betterproto.string_field(12) + """ + price_quorum is the minimum percentage of power that needs to be reached for a price to be processed. + """ + + max_signal_ids_per_signing: int = betterproto.uint64_field(13) + """ + MaxSignalIDsPerSigning is the maximum number of signals allowed in a single tss signing request. + """ + + +@dataclass(eq=False, repr=False) +class MsgVote(betterproto.Message): + """MsgVote is the transaction message to vote signals.""" + + voter: str = betterproto.string_field(1) + """voter is the address of the voter that wants to vote signals.""" + + signals: List["Signal"] = betterproto.message_field(2) + """signals is a list of submitted signals.""" + + +@dataclass(eq=False, repr=False) +class MsgVoteResponse(betterproto.Message): + """MsgVoteResponse is the response type for the Msg/Vote RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgSubmitSignalPrices(betterproto.Message): + """ + MsgSubmitSignalPrices is the transaction message to submit multiple signal prices. + """ + + validator: str = betterproto.string_field(1) + """ + validator is the address of the validator that is performing the operation. + """ + + timestamp: int = betterproto.int64_field(2) + """timestamp is the timestamp used as reference for the data.""" + + signal_prices: List["SignalPrice"] = betterproto.message_field(3) + """signal_prices is a list of signal prices to submit.""" + + +@dataclass(eq=False, repr=False) +class MsgSubmitSignalPricesResponse(betterproto.Message): + """ + MsgSubmitSignalPricesResponse is the response type for the Msg/SubmitSignalPrices RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateReferenceSourceConfig(betterproto.Message): + """ + MsgUpdateReferenceSourceConfig is the transaction message to update reference price source's configuration. + """ + + admin: str = betterproto.string_field(1) + """admin is the address of the admin that is performing the operation.""" + + reference_source_config: "ReferenceSourceConfig" = betterproto.message_field(2) + """ + reference_source_config is the information of reference price source. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateReferenceSourceConfigResponse(betterproto.Message): + """ + MsgUpdateReferenceSourceConfigResponse is the response type for the Msg/UpdateReferenceSourceConfig RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the transaction message to update parameters.""" + + authority: str = betterproto.string_field(1) + """authority is the address of the governance account.""" + + params: "Params" = betterproto.message_field(2) + """params is the x/feeds parameters to update.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse is the response type for the Msg/UpdateParams RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryCurrentFeedsRequest(betterproto.Message): + """ + QueryCurrentFeedsRequest is the request type for the Query/CurrentFeeds RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryCurrentFeedsResponse(betterproto.Message): + """ + QueryCurrentFeedsResponse is the response type for the Query/CurrentFeeds RPC method. + """ + + current_feeds: "CurrentFeedWithDeviations" = betterproto.message_field(1) + """ + current_feeds is a list of currently supported feed-with-deviations, and its last update time and block. + """ + + +@dataclass(eq=False, repr=False) +class QueryIsFeederRequest(betterproto.Message): + """ + QueryIsFeederRequest is the request type for the Query/IsFeeder RPC method. + """ + + validator: str = betterproto.string_field(1) + """validator is a validator address.""" + + feeder: str = betterproto.string_field(2) + """feeder is a candidate account.""" + + +@dataclass(eq=False, repr=False) +class QueryIsFeederResponse(betterproto.Message): + """ + QueryIsFeederResponse is the response type for the Query/IsFeeder RPC method. + """ + + is_feeder: bool = betterproto.bool_field(1) + """is_feeder is true if this account has been granted by validator.""" + + +@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 is the parameters of the module.""" + + +@dataclass(eq=False, repr=False) +class QueryPriceRequest(betterproto.Message): + """ + QueryPriceRequest is the request type for the Query/Price RPC method. + """ + + signal_id: str = betterproto.string_field(1) + """signal_id is the signal id to query the price for.""" + + +@dataclass(eq=False, repr=False) +class QueryPriceResponse(betterproto.Message): + """ + QueryPriceResponse is the response type for the Query/Price RPC method. + """ + + price: "Price" = betterproto.message_field(1) + """price is the aggregated price of the signal id.""" + + +@dataclass(eq=False, repr=False) +class QueryPricesRequest(betterproto.Message): + """ + QueryPricesRequest is the request type for the Query/Prices RPC method. + """ + + signal_ids: List[str] = betterproto.string_field(1) + """signal_ids is a list of signal ids to query prices for.""" + + +@dataclass(eq=False, repr=False) +class QueryPricesResponse(betterproto.Message): + """ + QueryPricesResponse is the response type for the Query/Prices RPC method. + """ + + prices: List["Price"] = betterproto.message_field(1) + """prices is a list of prices.""" + + +@dataclass(eq=False, repr=False) +class QueryAllPricesRequest(betterproto.Message): + """ + QueryAllPricesRequest is the request type for the Query/AllPrices RPC method. + """ + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(1) + ) + """pagination is the pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryAllPricesResponse(betterproto.Message): + """ + QueryAllPricesResponse is the response type for the Query/AllPrices RPC method. + """ + + prices: List["Price"] = betterproto.message_field(1) + """prices is a list of prices.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination is the pagination information in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryReferenceSourceConfigRequest(betterproto.Message): + """ + QueryReferenceSourceConfigRequest is the request type for the Query/ReferenceSourceConfig RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryReferenceSourceConfigResponse(betterproto.Message): + """ + QueryReferenceSourceConfigResponse is the response type for the Query/ReferenceSourceConfig RPC method. + """ + + reference_source_config: "ReferenceSourceConfig" = betterproto.message_field(1) + """ + reference_source_config is the information about the reference price source. + """ + + +@dataclass(eq=False, repr=False) +class QuerySignalTotalPowersRequest(betterproto.Message): + """ + QuerySignalTotalPowersRequest is the request type for the Query/SignalTotalPowers RPC method. + """ + + signal_ids: List[str] = betterproto.string_field(1) + """signal_ids is a list of signal ids to query.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(2) + ) + """pagination is the pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QuerySignalTotalPowersResponse(betterproto.Message): + """ + QuerySignalTotalPowersResponse is the response type for the Query/SignalTotalPowers RPC method. + """ + + signal_total_powers: List["Signal"] = betterproto.message_field(1) + """signal_total_powers is a list of signal-total-powers.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination is the pagination information in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryValidValidatorRequest(betterproto.Message): + """ + QueryValidValidatorRequest is the request type for the Query/ValidValidator RPC method. + """ + + validator: str = betterproto.string_field(1) + """validator is the validator address to query the flag.""" + + +@dataclass(eq=False, repr=False) +class QueryValidValidatorResponse(betterproto.Message): + """ + QueryValidValidatorResponse is the response type for the Query/ValidValidator RPC method. + """ + + valid: bool = betterproto.bool_field(1) + """valid is a valid flag.""" + + +@dataclass(eq=False, repr=False) +class QueryValidatorPricesRequest(betterproto.Message): + """ + QueryValidatorPricesRequest is the request type for the Query/ValidatorPrices RPC method. + """ + + validator: str = betterproto.string_field(1) + """validator is the validator address to query prices for.""" + + signal_ids: List[str] = betterproto.string_field(2) + """signal_ids is the list of signal ids to query the price for.""" + + +@dataclass(eq=False, repr=False) +class QueryValidatorPricesResponse(betterproto.Message): + """ + QueryValidatorPricesResponse is the response type for the Query/ValidatorPrices RPC method. + """ + + validator_prices: List["ValidatorPrice"] = betterproto.message_field(1) + """validator_prices is a list of prices submitted by the validator.""" + + +@dataclass(eq=False, repr=False) +class QueryVoteRequest(betterproto.Message): + """QueryVoteRequest is the request type for the Query/Vote RPC method.""" + + voter: str = betterproto.string_field(1) + """voter is the voter address to query signal for.""" + + +@dataclass(eq=False, repr=False) +class QueryVoteResponse(betterproto.Message): + """ + QueryVoteResponse is the response type for the Query/Vote RPC method. + """ + + signals: List["Signal"] = betterproto.message_field(1) + """signals is a list of signals submitted by the voter.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """ + GenesisState is a structure that defines the feeds module's genesis state. + """ + + params: "Params" = betterproto.message_field(1) + """params is all parameters of the module.""" + + votes: List["Vote"] = betterproto.message_field(2) + """votes is a list of voter signals.""" + + reference_source_config: "ReferenceSourceConfig" = betterproto.message_field(3) + """ + reference_source_config is the information about reference price config. + """ + + +class MsgStub(betterproto.ServiceStub): + 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( + "/band.feeds.v1beta1.Msg/Vote", + msg_vote, + MsgVoteResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def submit_signal_prices( + self, + msg_submit_signal_prices: "MsgSubmitSignalPrices", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSubmitSignalPricesResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Msg/SubmitSignalPrices", + msg_submit_signal_prices, + MsgSubmitSignalPricesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_reference_source_config( + self, + msg_update_reference_source_config: "MsgUpdateReferenceSourceConfig", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateReferenceSourceConfigResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Msg/UpdateReferenceSourceConfig", + msg_update_reference_source_config, + MsgUpdateReferenceSourceConfigResponse, + 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( + "/band.feeds.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def current_feeds( + self, + query_current_feeds_request: "QueryCurrentFeedsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryCurrentFeedsResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/CurrentFeeds", + query_current_feeds_request, + QueryCurrentFeedsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def is_feeder( + self, + query_is_feeder_request: "QueryIsFeederRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryIsFeederResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/IsFeeder", + query_is_feeder_request, + QueryIsFeederResponse, + 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( + "/band.feeds.v1beta1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def price( + self, + query_price_request: "QueryPriceRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPriceResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/Price", + query_price_request, + QueryPriceResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def prices( + self, + query_prices_request: "QueryPricesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPricesResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/Prices", + query_prices_request, + QueryPricesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def all_prices( + self, + query_all_prices_request: "QueryAllPricesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryAllPricesResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/AllPrices", + query_all_prices_request, + QueryAllPricesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def reference_source_config( + self, + query_reference_source_config_request: "QueryReferenceSourceConfigRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryReferenceSourceConfigResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/ReferenceSourceConfig", + query_reference_source_config_request, + QueryReferenceSourceConfigResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def signal_total_powers( + self, + query_signal_total_powers_request: "QuerySignalTotalPowersRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySignalTotalPowersResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/SignalTotalPowers", + query_signal_total_powers_request, + QuerySignalTotalPowersResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def valid_validator( + self, + query_valid_validator_request: "QueryValidValidatorRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryValidValidatorResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/ValidValidator", + query_valid_validator_request, + QueryValidValidatorResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def validator_prices( + self, + query_validator_prices_request: "QueryValidatorPricesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryValidatorPricesResponse": + return await self._unary_unary( + "/band.feeds.v1beta1.Query/ValidatorPrices", + query_validator_prices_request, + QueryValidatorPricesResponse, + 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( + "/band.feeds.v1beta1.Query/Vote", + query_vote_request, + QueryVoteResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def vote(self, msg_vote: "MsgVote") -> "MsgVoteResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def submit_signal_prices( + self, msg_submit_signal_prices: "MsgSubmitSignalPrices" + ) -> "MsgSubmitSignalPricesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_reference_source_config( + self, msg_update_reference_source_config: "MsgUpdateReferenceSourceConfig" + ) -> "MsgUpdateReferenceSourceConfigResponse": + 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_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_submit_signal_prices( + self, + stream: "grpclib.server.Stream[MsgSubmitSignalPrices, MsgSubmitSignalPricesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.submit_signal_prices(request) + await stream.send_message(response) + + async def __rpc_update_reference_source_config( + self, + stream: "grpclib.server.Stream[MsgUpdateReferenceSourceConfig, MsgUpdateReferenceSourceConfigResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_reference_source_config(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 { + "/band.feeds.v1beta1.Msg/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + MsgVote, + MsgVoteResponse, + ), + "/band.feeds.v1beta1.Msg/SubmitSignalPrices": grpclib.const.Handler( + self.__rpc_submit_signal_prices, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitSignalPrices, + MsgSubmitSignalPricesResponse, + ), + "/band.feeds.v1beta1.Msg/UpdateReferenceSourceConfig": grpclib.const.Handler( + self.__rpc_update_reference_source_config, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateReferenceSourceConfig, + MsgUpdateReferenceSourceConfigResponse, + ), + "/band.feeds.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def current_feeds( + self, query_current_feeds_request: "QueryCurrentFeedsRequest" + ) -> "QueryCurrentFeedsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def is_feeder( + self, query_is_feeder_request: "QueryIsFeederRequest" + ) -> "QueryIsFeederResponse": + 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 price( + self, query_price_request: "QueryPriceRequest" + ) -> "QueryPriceResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def prices( + self, query_prices_request: "QueryPricesRequest" + ) -> "QueryPricesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def all_prices( + self, query_all_prices_request: "QueryAllPricesRequest" + ) -> "QueryAllPricesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def reference_source_config( + self, query_reference_source_config_request: "QueryReferenceSourceConfigRequest" + ) -> "QueryReferenceSourceConfigResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def signal_total_powers( + self, query_signal_total_powers_request: "QuerySignalTotalPowersRequest" + ) -> "QuerySignalTotalPowersResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def valid_validator( + self, query_valid_validator_request: "QueryValidValidatorRequest" + ) -> "QueryValidValidatorResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def validator_prices( + self, query_validator_prices_request: "QueryValidatorPricesRequest" + ) -> "QueryValidatorPricesResponse": + 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 __rpc_current_feeds( + self, + stream: "grpclib.server.Stream[QueryCurrentFeedsRequest, QueryCurrentFeedsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.current_feeds(request) + await stream.send_message(response) + + async def __rpc_is_feeder( + self, + stream: "grpclib.server.Stream[QueryIsFeederRequest, QueryIsFeederResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.is_feeder(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_price( + self, stream: "grpclib.server.Stream[QueryPriceRequest, QueryPriceResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.price(request) + await stream.send_message(response) + + async def __rpc_prices( + self, stream: "grpclib.server.Stream[QueryPricesRequest, QueryPricesResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.prices(request) + await stream.send_message(response) + + async def __rpc_all_prices( + self, + stream: "grpclib.server.Stream[QueryAllPricesRequest, QueryAllPricesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.all_prices(request) + await stream.send_message(response) + + async def __rpc_reference_source_config( + self, + stream: "grpclib.server.Stream[QueryReferenceSourceConfigRequest, QueryReferenceSourceConfigResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.reference_source_config(request) + await stream.send_message(response) + + async def __rpc_signal_total_powers( + self, + stream: "grpclib.server.Stream[QuerySignalTotalPowersRequest, QuerySignalTotalPowersResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.signal_total_powers(request) + await stream.send_message(response) + + async def __rpc_valid_validator( + self, + stream: "grpclib.server.Stream[QueryValidValidatorRequest, QueryValidValidatorResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.valid_validator(request) + await stream.send_message(response) + + async def __rpc_validator_prices( + self, + stream: "grpclib.server.Stream[QueryValidatorPricesRequest, QueryValidatorPricesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.validator_prices(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) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.feeds.v1beta1.Query/CurrentFeeds": grpclib.const.Handler( + self.__rpc_current_feeds, + grpclib.const.Cardinality.UNARY_UNARY, + QueryCurrentFeedsRequest, + QueryCurrentFeedsResponse, + ), + "/band.feeds.v1beta1.Query/IsFeeder": grpclib.const.Handler( + self.__rpc_is_feeder, + grpclib.const.Cardinality.UNARY_UNARY, + QueryIsFeederRequest, + QueryIsFeederResponse, + ), + "/band.feeds.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + "/band.feeds.v1beta1.Query/Price": grpclib.const.Handler( + self.__rpc_price, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPriceRequest, + QueryPriceResponse, + ), + "/band.feeds.v1beta1.Query/Prices": grpclib.const.Handler( + self.__rpc_prices, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPricesRequest, + QueryPricesResponse, + ), + "/band.feeds.v1beta1.Query/AllPrices": grpclib.const.Handler( + self.__rpc_all_prices, + grpclib.const.Cardinality.UNARY_UNARY, + QueryAllPricesRequest, + QueryAllPricesResponse, + ), + "/band.feeds.v1beta1.Query/ReferenceSourceConfig": grpclib.const.Handler( + self.__rpc_reference_source_config, + grpclib.const.Cardinality.UNARY_UNARY, + QueryReferenceSourceConfigRequest, + QueryReferenceSourceConfigResponse, + ), + "/band.feeds.v1beta1.Query/SignalTotalPowers": grpclib.const.Handler( + self.__rpc_signal_total_powers, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySignalTotalPowersRequest, + QuerySignalTotalPowersResponse, + ), + "/band.feeds.v1beta1.Query/ValidValidator": grpclib.const.Handler( + self.__rpc_valid_validator, + grpclib.const.Cardinality.UNARY_UNARY, + QueryValidValidatorRequest, + QueryValidValidatorResponse, + ), + "/band.feeds.v1beta1.Query/ValidatorPrices": grpclib.const.Handler( + self.__rpc_validator_prices, + grpclib.const.Cardinality.UNARY_UNARY, + QueryValidatorPricesRequest, + QueryValidatorPricesResponse, + ), + "/band.feeds.v1beta1.Query/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVoteRequest, + QueryVoteResponse, + ), + } diff --git a/pyband/proto/band/globalfee/__init__.py b/pyband/proto/band/globalfee/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/globalfee/v1beta1/__init__.py b/pyband/proto/band/globalfee/v1beta1/__init__.py new file mode 100644 index 0000000..9525c8b --- /dev/null +++ b/pyband/proto/band/globalfee/v1beta1/__init__.py @@ -0,0 +1,184 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/globalfee/v1beta1/genesis.proto, band/globalfee/v1beta1/query.proto, band/globalfee/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +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__ + + +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 - initial state of module""" + + params: "Params" = betterproto.message_field(1) + """Params of this module""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the set of module parameters.""" + + minimum_gas_prices: List["__cosmos_base_v1_beta1__.DecCoin"] = ( + betterproto.message_field(1) + ) + """ + Minimum stores the minimum gas price(s) for all TX on the chain. + When multiple coins are defined then they are accepted alternatively. + The list must be sorted by denoms asc. No duplicate denoms or zero amount + values allowed. For more information see + https://docs.cosmos.network/main/modules/auth#concepts + """ + + +@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/globalfee 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 request type for the Query/Params RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class QueryParamsResponse(betterproto.Message): + """ + QueryParamsResponse is response type for the Query/Params RPC method. + """ + + params: "Params" = betterproto.message_field(1) + """pagination defines an optional pagination for the request.""" + + +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( + "/band.globalfee.v1beta1.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( + "/band.globalfee.v1beta1.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 { + "/band.globalfee.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": + 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 { + "/band.globalfee.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/pyband/proto/band/oracle/__init__.py b/pyband/proto/band/oracle/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/oracle/v1/__init__.py b/pyband/proto/band/oracle/v1/__init__.py similarity index 84% rename from pyband/proto/oracle/v1/__init__.py rename to pyband/proto/band/oracle/v1/__init__.py index ce9ac21..3ef4044 100644 --- a/pyband/proto/oracle/v1/__init__.py +++ b/pyband/proto/band/oracle/v1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: oracle/v1/genesis.proto, oracle/v1/oracle.proto, oracle/v1/query.proto, oracle/v1/tx.proto +# sources: band/oracle/v1/genesis.proto, band/oracle/v1/oracle.proto, band/oracle/v1/query.proto, band/oracle/v1/tx.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from datetime import datetime from typing import ( @@ -14,7 +16,7 @@ import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ...cosmos.base import v1beta1 as __cosmos_base_v1_beta1__ +from ....cosmos.base import v1beta1 as __cosmos_base_v1_beta1__ if TYPE_CHECKING: @@ -26,21 +28,39 @@ class ResolveStatus(betterproto.Enum): """ResolveStatus encodes the status of an oracle request.""" - RESOLVE_STATUS_OPEN_UNSPECIFIED = 0 + OPEN_UNSPECIFIED = 0 """Open - the request is not yet resolved.""" - RESOLVE_STATUS_SUCCESS = 1 + SUCCESS = 1 """Success - the request has been resolved successfully with no errors.""" - RESOLVE_STATUS_FAILURE = 2 + FAILURE = 2 """Failure - an error occured during the request's resolve call.""" - RESOLVE_STATUS_EXPIRED = 3 + EXPIRED = 3 """ Expired - the request does not get enough reports from validator within the - timeframe. + timeframe. + """ + + +class Encoder(betterproto.Enum): + """ + Encoder is an enumerator that defines the mode of encoding message in tss module. """ + UNSPECIFIED = 0 + """ENCODER_UNSPECIFIED is for unspecified value""" + + PROTO = 1 + """ENCODER_PROTO is for proto encoding""" + + FULL_ABI = 2 + """ENCODER_FULL_ABI is for ABI encoding for full data""" + + PARTIAL_ABI = 3 + """ENCODER_PARTIAL_ABI is for ABI encoding for only important data""" + @dataclass(eq=False, repr=False) class DataSource(betterproto.Message): @@ -59,8 +79,8 @@ class DataSource(betterproto.Message): filename: str = betterproto.string_field(4) """ - Filename is string of file name used as reference for locating data source - file stored in bandchain nodes + Filename is string of file name used as reference for locating + data source file stored in bandchain nodes """ treasury: str = betterproto.string_field(5) @@ -71,15 +91,14 @@ class DataSource(betterproto.Message): fee: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(6) """ Fee is the data source fee per ask_count that data provider will receive - from requester. + from requester. """ @dataclass(eq=False, repr=False) class OracleScript(betterproto.Message): """ - OracleScript is the data structure for storing oracle scripts in the - storage. + OracleScript is the data structure for storing oracle scripts in the storage. """ owner: str = betterproto.string_field(1) @@ -93,20 +112,22 @@ class OracleScript(betterproto.Message): filename: str = betterproto.string_field(4) """ - Filename is string of file name used as reference for locating compiled - oracle script WASM file stored in bandchain nodes + Filename is string of file name used as reference for locating + compiled oracle script WASM file stored in bandchain nodes """ schema: str = betterproto.string_field(5) """ - Schema is the schema of the oracle script input/output which is formatted - in OBI format e.g. "{symbol:string,multiplier:u64}/{px:u64}" + Schema is the schema of the oracle script input/output + which is formatted in OBI format e.g. + "{symbol:string,multiplier:u64}/{px:u64}" """ source_code_url: str = betterproto.string_field(6) """ - SourceCodeURL is the URL of oracle script's source code. It is recommendded - to store source code on IPFS and get its URL to preserve decentralization. + SourceCodeURL is the URL of oracle script's source code. + It is recommendded to store source code on IPFS and get its URL to preserve + decentralization. """ @@ -127,7 +148,7 @@ class RawRequest(betterproto.Message): calldata: bytes = betterproto.bytes_field(3) """ Calldata is the data used as argument params for executing data source - script + script """ @@ -143,14 +164,15 @@ class RawReport(betterproto.Message): exit_code: int = betterproto.uint32_field(2) """ ExitCode is status code provided by validators to specify error, if any. - Exit code is usually filled by the exit code returned from execution of - specified data source script. With code 0 means there is no error. + Exit code is usually filled by the exit code returned from execution of + specified data source script. With code 0 means there is no error. """ data: bytes = betterproto.bytes_field(3) """ - Data is raw result provided by validators. It is usually filled by the - result from execution of specified data source script. + Data is raw result provided by validators. + It is usually filled by the result from execution of specified data source + script. """ @@ -167,13 +189,13 @@ class Request(betterproto.Message): requested_validators: List[str] = betterproto.string_field(3) """ RequestedValidators is a list of validator addresses that are assigned for - fulfilling the request + fulfilling the request """ min_count: int = betterproto.uint64_field(4) """ MinCount is minimum number of validators required for fulfilling the - request + request """ request_height: int = betterproto.int64_field(5) @@ -186,26 +208,35 @@ class Request(betterproto.Message): client_id: str = betterproto.string_field(7) """ - ClientID is arbitrary id provided by requester. It is used by client-side - for referencing the request + ClientID is arbitrary id provided by requester. + It is used by client-side for referencing the request """ raw_requests: List["RawRequest"] = betterproto.message_field(8) """ RawRequests is a list of raw requests specified by execution of oracle - script + script """ ibc_channel: "IbcChannel" = betterproto.message_field(9) """ IBCChannel is an IBC channel info of the other chain, which contains a - channel and a port to allow bandchain connect to that chain. This field - allows other chain be able to request data from bandchain via IBC. + channel and a port to allow bandchain connect to that chain. This field + allows other chain be able to request data from bandchain via IBC. """ execute_gas: int = betterproto.uint64_field(10) """ExecuteGas is amount of gas to reserve for executing""" + tss_encoder: Encoder = betterproto.enum_field(11) + """TSSEncoder is the mode of encoding oracle result signature order.""" + + requester: str = betterproto.string_field(12) + """Requester is the address of person who requests the data.""" + + fee_limit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(13) + """FeeLimit is the maximum tokens that will be paid for this request.""" + @dataclass(eq=False, repr=False) class Report(betterproto.Message): @@ -217,59 +248,59 @@ class Report(betterproto.Message): in_before_resolve: bool = betterproto.bool_field(2) """ InBeforeResolve indicates whether the report is submitted before the - request resolved + request resolved """ raw_reports: List["RawReport"] = betterproto.message_field(3) """ - RawReports is list of raw reports provided by the validator. Each raw - report has different external ID + RawReports is list of raw reports provided by the validator. + Each raw report has different external ID """ @dataclass(eq=False, repr=False) class OracleRequestPacketData(betterproto.Message): """ - OracleRequestPacketData encodes an oracle request sent from other - blockchains to BandChain. + OracleRequestPacketData encodes an oracle request sent from other blockchains + to BandChain. """ client_id: str = betterproto.string_field(1) """ ClientID is the unique identifier of this oracle request, as specified by - the client. This same unique ID will be sent back to the requester with the - oracle response. + the client. This same unique ID will be sent back to the requester with the + oracle response. """ oracle_script_id: int = betterproto.uint64_field(2) """ OracleScriptID is the unique identifier of the oracle script to be - executed. + executed. """ calldata: bytes = betterproto.bytes_field(3) """ Calldata is the OBI-encoded calldata bytes available for oracle executor to - read. + read. """ ask_count: int = betterproto.uint64_field(4) """ AskCount is the number of validators that are requested to respond to this - oracle request. Higher value means more security, at a higher gas cost. + oracle request. Higher value means more security, at a higher gas cost. """ min_count: int = betterproto.uint64_field(5) """ MinCount is the minimum number of validators necessary for the request to - proceed to the execution phase. Higher value means more security, at the - cost of liveness. + proceed to the execution phase. Higher value means more security, at the + cost of liveness. """ fee_limit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(6) """ FeeLimit is the maximum tokens that will be paid to all data source - providers. + providers. """ prepare_gas: int = betterproto.uint64_field(7) @@ -278,12 +309,15 @@ class OracleRequestPacketData(betterproto.Message): execute_gas: int = betterproto.uint64_field(8) """ExecuteGas is amount of gas to reserve for executing""" + tss_encoder: Encoder = betterproto.enum_field(9) + """TSSEncoder is the mode of encoding oracle result signature order.""" + @dataclass(eq=False, repr=False) class OracleRequestPacketAcknowledgement(betterproto.Message): """ - OracleRequestPacketAcknowledgement encodes an oracle request - acknowledgement send back to requester chain. + OracleRequestPacketAcknowledgement encodes an oracle request acknowledgement + send back to requester chain. """ request_id: int = betterproto.uint64_field(1) @@ -294,13 +328,13 @@ class OracleRequestPacketAcknowledgement(betterproto.Message): class OracleResponsePacketData(betterproto.Message): """ OracleResponsePacketData encodes an oracle response from BandChain to the - requester. + requester. """ client_id: str = betterproto.string_field(1) """ ClientID is the unique identifier matched with that of the oracle request - packet. + packet. """ request_id: int = betterproto.uint64_field(2) @@ -309,32 +343,32 @@ class OracleResponsePacketData(betterproto.Message): ans_count: int = betterproto.uint64_field(3) """ AnsCount is the number of validators among to the asked validators that - actually responded to this oracle request prior to this oracle request - being resolved. + actually responded to this oracle request prior to this oracle request + being resolved. """ request_time: int = betterproto.int64_field(4) """ RequestTime is the UNIX epoch time at which the request was sent to - BandChain. + BandChain. """ resolve_time: int = betterproto.int64_field(5) """ ResolveTime is the UNIX epoch time at which the request was resolved to the - final result. + final result. """ resolve_status: "ResolveStatus" = betterproto.enum_field(6) """ ResolveStatus is the status of this oracle request, which can be OK, - FAILURE, or EXPIRED. + FAILURE, or EXPIRED. """ result: bytes = betterproto.bytes_field(7) """ Result is the final aggregated value encoded in OBI format. Only available - if status if OK. + if status if OK. """ @@ -345,14 +379,14 @@ class Result(betterproto.Message): client_id: str = betterproto.string_field(1) """ ClientID is the unique identifier of this oracle request, as specified by - the client. This same unique ID will be sent back to the requester with the - oracle response. + the client. This same unique ID will be sent back to the requester with the + oracle response. """ oracle_script_id: int = betterproto.uint64_field(2) """ OracleScriptID is the unique identifier of the oracle script to be - executed. + executed. """ calldata: bytes = betterproto.bytes_field(3) @@ -363,14 +397,14 @@ class Result(betterproto.Message): ask_count: int = betterproto.uint64_field(4) """ AskCount is the number of validators that are requested to respond to this - oracle request. Higher value means more security, at a higher gas cost. + oracle request. Higher value means more security, at a higher gas cost. """ min_count: int = betterproto.uint64_field(5) """ MinCount is the minimum number of validators necessary for the request to - proceed to the execution phase. Higher value means more security, at the - cost of liveness. + proceed to the execution phase. Higher value means more security, at the + cost of liveness. """ request_id: int = betterproto.uint64_field(6) @@ -379,32 +413,46 @@ class Result(betterproto.Message): ans_count: int = betterproto.uint64_field(7) """ AnsCount is the number of validators among to the asked validators that - actually responded to this oracle request prior to this oracle request - being resolved. + actually responded to this oracle request prior to this oracle request + being resolved. """ request_time: int = betterproto.int64_field(8) """ RequestTime is the UNIX epoch time at which the request was sent to - BandChain. + BandChain. """ resolve_time: int = betterproto.int64_field(9) """ ResolveTime is the UNIX epoch time at which the request was resolved to the - final result. + final result. """ resolve_status: "ResolveStatus" = betterproto.enum_field(10) """ ResolveStatus is the status of this oracle request, which can be OK, - FAILURE, or EXPIRED. + FAILURE, or EXPIRED. """ result: bytes = betterproto.bytes_field(11) """Result is the final aggregated value only available if status if OK.""" +@dataclass(eq=False, repr=False) +class SigningResult(betterproto.Message): + """SigningResult encodes a result of signing of request""" + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the id of the bandtss signing""" + + error_codespace: str = betterproto.string_field(2) + """error_codespace is the codespace of the error""" + + error_code: int = betterproto.uint64_field(3) + """error_code is the code in the codespace of the error""" + + @dataclass(eq=False, repr=False) class ValidatorStatus(betterproto.Message): """ @@ -413,9 +461,9 @@ class ValidatorStatus(betterproto.Message): is_active: bool = betterproto.bool_field(1) """ - IsActive is a boolean indicating active status of validator. The validator - will be deactivated when they are unable to send reports to fulfill oracle - request before the request expired. + IsActive is a boolean indicating active status of validator. + The validator will be deactivated when they are unable to send reports + to fulfill oracle request before the request expired. """ since: datetime = betterproto.message_field(2) @@ -438,14 +486,13 @@ class ActiveValidator(betterproto.Message): @dataclass(eq=False, repr=False) class Params(betterproto.Message): """ - Params is the data structure that keeps the parameters of the oracle - module. + Params is the data structure that keeps the parameters of the oracle module. """ max_raw_request_count: int = betterproto.uint64_field(1) """ MaxRawRequestCount is the maximum number of data source raw requests a - request can make. + request can make. """ max_ask_count: int = betterproto.uint64_field(2) @@ -461,49 +508,49 @@ class Params(betterproto.Message): max_report_data_size: int = betterproto.uint64_field(4) """ MaxReportDataSize is the maximum size limit of report data (bytes) in a - report. + report. """ expiration_block_count: int = betterproto.uint64_field(5) """ ExpirationBlockCount is the number of blocks a request stays valid before - it gets expired due to insufficient reports. + it gets expired due to insufficient reports. """ base_owasm_gas: int = betterproto.uint64_field(6) """ BaseOwasmGas is the base amount of Cosmos-SDK gas charged for owasm - execution. + execution. """ per_validator_request_gas: int = betterproto.uint64_field(7) """ PerValidatorRequestGas is the amount of Cosmos-SDK gas charged per - requested validator. + requested validator. """ sampling_try_count: int = betterproto.uint64_field(8) """ SamplingTryCount the number of validator sampling tries to pick the highest - voting power subset of validators to perform an oracle task. + voting power subset of validators to perform an oracle task. """ oracle_reward_percentage: int = betterproto.uint64_field(9) """ OracleRewardPercentage is the percentage of block rewards allocated to - active oracle validators. + active oracle validators. """ inactive_penalty_duration: int = betterproto.uint64_field(10) """ InactivePenaltyDuration is the duration period where a validator cannot - activate back after missing an oracle report. + activate back after missing an oracle report. """ ibc_request_enabled: bool = betterproto.bool_field(11) """ IBCRequestEnabled is a flag indicating whether sending oracle request via - IBC is allowed + IBC is allowed """ @@ -521,27 +568,27 @@ class PendingResolveList(betterproto.Message): class IbcChannel(betterproto.Message): """ IBCChannel is information of IBC protocol to allow communicating with other - chain + chain """ port_id: str = betterproto.string_field(1) """ PortID is port ID used for sending response packet when request is - resolved. + resolved. """ channel_id: str = betterproto.string_field(2) """ ChannelID is channel ID used for sending response packet when request is - resolved. + resolved. """ @dataclass(eq=False, repr=False) class RequestVerification(betterproto.Message): """ - RequestVerification is a message that is constructed and signed by a - reporter to be used as a part of verification of oracle request. + RequestVerification is a message that is constructed and signed by a reporter + to be used as a part of verification of oracle request. """ chain_id: str = betterproto.string_field(1) @@ -567,13 +614,13 @@ class PriceResult(betterproto.Message): symbol: str = betterproto.string_field(1) """ Symbol is unit of data indicating what the data is. It is price currencies - for this case. + for this case. """ multiplier: int = betterproto.uint64_field(2) """ Multiplier is a number used for left-shifting value to eliminate decimal - digits + digits """ px: int = betterproto.uint64_field(3) @@ -587,8 +634,21 @@ class PriceResult(betterproto.Message): resolve_time: int = betterproto.int64_field(5) """ ResolveTime is epoch timestamp indicating the time when the request had - been resolved + been resolved + """ + + +@dataclass(eq=False, repr=False) +class OracleResultSignatureOrder(betterproto.Message): """ + OracleResultSignatureOrder defines a request id to request bandtss signature from the oracle result. + """ + + request_id: int = betterproto.uint64_field(1) + """RequestID is oracle's unique identifier for this oracle request.""" + + encoder: Encoder = betterproto.enum_field(3) + """encoder is the mode of encoding oracle result signature order.""" @dataclass(eq=False, repr=False) @@ -607,7 +667,7 @@ class MsgRequestData(betterproto.Message): min_count: int = betterproto.uint64_field(4) """ MinCount is the minimum number of validators sufficient to resolve the - oracle tasks. + oracle tasks. """ client_id: str = betterproto.string_field(5) @@ -618,7 +678,7 @@ class MsgRequestData(betterproto.Message): fee_limit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(6) """ FeeLimit is the maximum tokens that will be paid to all data source - providers. + providers. """ prepare_gas: int = betterproto.uint64_field(7) @@ -630,6 +690,9 @@ class MsgRequestData(betterproto.Message): sender: str = betterproto.string_field(9) """Sender is an account address of message sender.""" + tss_encoder: Encoder = betterproto.enum_field(10) + """TSSEncoder is the mode of encoding oracle result signature order.""" + @dataclass(eq=False, repr=False) class MsgRequestDataResponse(betterproto.Message): @@ -650,7 +713,7 @@ class MsgReportData(betterproto.Message): raw_reports: List["RawReport"] = betterproto.message_field(2) """ RawReports is the list of report information provided by data sources - identified by external ID + identified by external ID """ validator: str = betterproto.string_field(3) @@ -674,19 +737,19 @@ class MsgCreateDataSource(betterproto.Message): description: str = betterproto.string_field(2) """ Description is the description of this data source used for display - (optional). + (optional). """ executable: bytes = betterproto.bytes_field(3) """ Executable is the content of executable script or binary file to be run by - validators upon execution. + validators upon execution. """ fee: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(4) """ Fee is the data source fee per ask_count that data provider will receive - from requester. + from requester. """ treasury: str = betterproto.string_field(5) @@ -697,7 +760,7 @@ class MsgCreateDataSource(betterproto.Message): owner: str = betterproto.string_field(6) """ Owner is the account address who is allowed to make further changes to the - data source. + data source. """ sender: str = betterproto.string_field(7) @@ -707,8 +770,7 @@ class MsgCreateDataSource(betterproto.Message): @dataclass(eq=False, repr=False) class MsgCreateDataSourceResponse(betterproto.Message): """ - MsgCreateDataSourceResponse is response data for MsgCreateDataSource - message + MsgCreateDataSourceResponse is response data for MsgCreateDataSource message """ pass @@ -729,19 +791,19 @@ class MsgEditDataSource(betterproto.Message): description: str = betterproto.string_field(3) """ Description is the description of this data source used for display - (optional). + (optional). """ executable: bytes = betterproto.bytes_field(4) """ Executable is the executable script or binary to be run by validators upon - execution. + execution. """ fee: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(5) """ Fee is the data source fee per ask_count that data provider will receive - from requester. + from requester. """ treasury: str = betterproto.string_field(6) @@ -750,13 +812,13 @@ class MsgEditDataSource(betterproto.Message): owner: str = betterproto.string_field(7) """ Owner is the address who is allowed to make further changes to the data - source. + source. """ sender: str = betterproto.string_field(8) """ Sender is the signer of this message. Must be the current data source's - owner. + owner. """ @@ -779,7 +841,7 @@ class MsgCreateOracleScript(betterproto.Message): description: str = betterproto.string_field(2) """ Description is the description of this oracle script used for display - (optional). + (optional). """ schema: str = betterproto.string_field(3) @@ -798,7 +860,7 @@ class MsgCreateOracleScript(betterproto.Message): owner: str = betterproto.string_field(6) """ Owner is the address who is allowed to make further changes to the oracle - script. + script. """ sender: str = betterproto.string_field(7) @@ -809,7 +871,7 @@ class MsgCreateOracleScript(betterproto.Message): class MsgCreateOracleScriptResponse(betterproto.Message): """ MsgCreateOracleScriptResponse is response data for MsgCreateOracleScript - message + message """ pass @@ -832,7 +894,7 @@ class MsgEditOracleScript(betterproto.Message): description: str = betterproto.string_field(3) """ Description is the description of this oracle script used for display - (optional). + (optional). """ schema: str = betterproto.string_field(4) @@ -851,21 +913,20 @@ class MsgEditOracleScript(betterproto.Message): owner: str = betterproto.string_field(7) """ Owner is an account address who is allowed to make further changes to the - oracle script. + oracle script. """ sender: str = betterproto.string_field(8) """ Sender is an account address who sign this message. Must be the current - oracle script's owner. + oracle script's owner. """ @dataclass(eq=False, repr=False) class MsgEditOracleScriptResponse(betterproto.Message): """ - MsgEditOracleScriptResponse is response data for MsgEditOracleScript - message + MsgEditOracleScriptResponse is response data for MsgEditOracleScript message """ pass @@ -875,14 +936,14 @@ class MsgEditOracleScriptResponse(betterproto.Message): class MsgActivate(betterproto.Message): """ MsgEditOracleScript is a message for activating a validator to become an - oracle provider. However, the activation can be revoked once the validator - is unable to provide data to fulfill requests + oracle provider. However, the activation can be revoked once the validator + is unable to provide data to fulfill requests """ validator: str = betterproto.string_field(1) """ Validator is the validator address who sign this message and request to be - activated. + activated. """ @@ -893,6 +954,37 @@ class MsgActivateResponse(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 of the governance account.""" + + params: "Params" = betterproto.message_field(2) + """ + params defines the x/oracle 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 QueryCountsRequest(betterproto.Message): """QueryCountsRequest is request type for the Query/Count RPC method.""" @@ -925,7 +1017,7 @@ class QueryDataRequest(betterproto.Message): data_hash: str = betterproto.string_field(1) """ DataHash is SHA256 hash of the file's content, which can be data source or - oracle script + oracle script """ @@ -950,8 +1042,7 @@ class QueryDataSourceRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryDataSourceResponse(betterproto.Message): """ - QueryDataSourceResponse is response type for the Query/DataSource RPC - method. + QueryDataSourceResponse is response type for the Query/DataSource RPC method. """ data_source: "DataSource" = betterproto.message_field(1) @@ -962,7 +1053,7 @@ class QueryDataSourceResponse(betterproto.Message): class QueryOracleScriptRequest(betterproto.Message): """ QueryOracleScriptRequest is request type for the Query/OracleScript RPC - method. + method. """ oracle_script_id: int = betterproto.uint64_field(1) @@ -973,7 +1064,7 @@ class QueryOracleScriptRequest(betterproto.Message): class QueryOracleScriptResponse(betterproto.Message): """ QueryOracleScriptResponse is response type for the Query/OracleScript RPC - method. + method. """ oracle_script: "OracleScript" = betterproto.message_field(1) @@ -1002,18 +1093,21 @@ class QueryRequestResponse(betterproto.Message): reports: List["Report"] = betterproto.message_field(2) """ Reports is list of result data as raw reports that are fulfilled by - assigned validators + assigned validators """ result: "Result" = betterproto.message_field(3) """Result is a final form of result data""" + signing: "SigningResult" = betterproto.message_field(4) + """Signing is the signing detail in the bandtss module.""" + @dataclass(eq=False, repr=False) class QueryPendingRequestsRequest(betterproto.Message): """ - QueryPendingRequestRequest is request type for the Query/PendingRequests - RPC method. + QueryPendingRequestRequest is request type for the Query/PendingRequests RPC + method. """ validator_address: str = betterproto.string_field(1) @@ -1024,7 +1118,7 @@ class QueryPendingRequestsRequest(betterproto.Message): class QueryPendingRequestsResponse(betterproto.Message): """ QueryPendingRequestResponse is response type for the Query/PendingRequests - RPC method. + RPC method. """ request_ids: List[int] = betterproto.uint64_field(1) @@ -1117,7 +1211,7 @@ class QueryReportersResponse(betterproto.Message): class QueryActiveValidatorsRequest(betterproto.Message): """ QueryActiveValidatorsRequest is request type for the Query/ActiveValidators - RPC method. + RPC method. """ pass @@ -1126,8 +1220,8 @@ class QueryActiveValidatorsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryActiveValidatorsResponse(betterproto.Message): """ - QueryActiveValidatorsResponse is response type for the - Query/ActiveValidators RPC method. + QueryActiveValidatorsResponse is response type for the Query/ActiveValidators + RPC method. """ validators: List["ActiveValidator"] = betterproto.message_field(1) @@ -1138,7 +1232,7 @@ class QueryActiveValidatorsResponse(betterproto.Message): class QueryRequestSearchRequest(betterproto.Message): """ QueryRequestSearchRequest is request type for the Query/RequestSearch RPC - method. + method. """ oracle_script_id: int = betterproto.uint64_field(1) @@ -1147,7 +1241,7 @@ class QueryRequestSearchRequest(betterproto.Message): calldata: str = betterproto.string_field(2) """ Calldata is OBI-encoded data in hex format as argument params for the - oracle script + oracle script """ ask_count: int = betterproto.uint64_field(3) @@ -1161,7 +1255,7 @@ class QueryRequestSearchRequest(betterproto.Message): class QueryRequestSearchResponse(betterproto.Message): """ QueryRequestSearchResponse is response type for the Query/RequestSearch RPC - method. + method. """ request: "QueryRequestResponse" = betterproto.message_field(1) @@ -1172,7 +1266,7 @@ class QueryRequestSearchResponse(betterproto.Message): class QueryRequestPriceRequest(betterproto.Message): """ QueryRequestPriceRequest is request type for the Query/RequestPrice RPC - method. + method. """ symbols: List[str] = betterproto.string_field(1) @@ -1189,7 +1283,7 @@ class QueryRequestPriceRequest(betterproto.Message): class QueryRequestPriceResponse(betterproto.Message): """ QueryRequestPriceResponse is response type for the Query/RequestPrice RPC - method. + method. """ price_results: List["PriceResult"] = betterproto.message_field(1) @@ -1200,13 +1294,13 @@ class QueryRequestPriceResponse(betterproto.Message): class QueryRequestVerificationRequest(betterproto.Message): """ QueryRequestVerificationRequest is request type for the - Query/RequestVerification RPC + Query/RequestVerification RPC """ chain_id: str = betterproto.string_field(1) """ ChainID is the chain ID to identify which chain ID is used for the - verification + verification """ validator: str = betterproto.string_field(2) @@ -1224,19 +1318,19 @@ class QueryRequestVerificationRequest(betterproto.Message): reporter: str = betterproto.string_field(6) """ Reporter is an bech32-encoded public key of the reporter authorized by the - validator + validator """ signature: bytes = betterproto.bytes_field(7) """ Signature is a signature signed by the reporter using reporter's private - key + key """ max_delay: int = betterproto.uint64_field(8) """ MaxDelay is a max number of RequestID delay acceptable in case of node - delay + delay """ @@ -1244,7 +1338,7 @@ class QueryRequestVerificationRequest(betterproto.Message): class QueryRequestVerificationResponse(betterproto.Message): """ QueryRequestVerificationResponse is response type for the - Query/RequestVerification RPC + Query/RequestVerification RPC """ chain_id: str = betterproto.string_field(1) @@ -1262,13 +1356,13 @@ class QueryRequestVerificationResponse(betterproto.Message): data_source_id: int = betterproto.uint64_field(5) """ DataSourceID is the ID of a data source that relates to the targeted - external ID + external ID """ is_delay: bool = betterproto.bool_field(6) """ IsDelay is a flag to tell that this request is not exist yet but in - MaxDelay range + MaxDelay range """ @@ -1277,15 +1371,14 @@ class GenesisState(betterproto.Message): """GenesisState defines the oracle 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.""" data_sources: List["DataSource"] = betterproto.message_field(2) - """DataSources are data sources to be installed during genesis phase""" + """DataSources are data sources to be installed during genesis phase.""" oracle_scripts: List["OracleScript"] = betterproto.message_field(3) """ - OracleScripts are list of oracle scripts to be installed during genesis - phase + OracleScripts are list of oracle scripts to be installed during genesis phase. """ @@ -1299,7 +1392,7 @@ async def request_data( metadata: Optional["MetadataLike"] = None ) -> "MsgRequestDataResponse": return await self._unary_unary( - "/oracle.v1.Msg/RequestData", + "/band.oracle.v1.Msg/RequestData", msg_request_data, MsgRequestDataResponse, timeout=timeout, @@ -1316,7 +1409,7 @@ async def report_data( metadata: Optional["MetadataLike"] = None ) -> "MsgReportDataResponse": return await self._unary_unary( - "/oracle.v1.Msg/ReportData", + "/band.oracle.v1.Msg/ReportData", msg_report_data, MsgReportDataResponse, timeout=timeout, @@ -1333,7 +1426,7 @@ async def create_data_source( metadata: Optional["MetadataLike"] = None ) -> "MsgCreateDataSourceResponse": return await self._unary_unary( - "/oracle.v1.Msg/CreateDataSource", + "/band.oracle.v1.Msg/CreateDataSource", msg_create_data_source, MsgCreateDataSourceResponse, timeout=timeout, @@ -1350,7 +1443,7 @@ async def edit_data_source( metadata: Optional["MetadataLike"] = None ) -> "MsgEditDataSourceResponse": return await self._unary_unary( - "/oracle.v1.Msg/EditDataSource", + "/band.oracle.v1.Msg/EditDataSource", msg_edit_data_source, MsgEditDataSourceResponse, timeout=timeout, @@ -1367,7 +1460,7 @@ async def create_oracle_script( metadata: Optional["MetadataLike"] = None ) -> "MsgCreateOracleScriptResponse": return await self._unary_unary( - "/oracle.v1.Msg/CreateOracleScript", + "/band.oracle.v1.Msg/CreateOracleScript", msg_create_oracle_script, MsgCreateOracleScriptResponse, timeout=timeout, @@ -1384,7 +1477,7 @@ async def edit_oracle_script( metadata: Optional["MetadataLike"] = None ) -> "MsgEditOracleScriptResponse": return await self._unary_unary( - "/oracle.v1.Msg/EditOracleScript", + "/band.oracle.v1.Msg/EditOracleScript", msg_edit_oracle_script, MsgEditOracleScriptResponse, timeout=timeout, @@ -1401,7 +1494,7 @@ async def activate( metadata: Optional["MetadataLike"] = None ) -> "MsgActivateResponse": return await self._unary_unary( - "/oracle.v1.Msg/Activate", + "/band.oracle.v1.Msg/Activate", msg_activate, MsgActivateResponse, timeout=timeout, @@ -1409,6 +1502,23 @@ async def activate( 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( + "/band.oracle.v1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + class QueryStub(betterproto.ServiceStub): async def counts( @@ -1420,7 +1530,7 @@ async def counts( metadata: Optional["MetadataLike"] = None ) -> "QueryCountsResponse": return await self._unary_unary( - "/oracle.v1.Query/Counts", + "/band.oracle.v1.Query/Counts", query_counts_request, QueryCountsResponse, timeout=timeout, @@ -1437,7 +1547,7 @@ async def data( metadata: Optional["MetadataLike"] = None ) -> "QueryDataResponse": return await self._unary_unary( - "/oracle.v1.Query/Data", + "/band.oracle.v1.Query/Data", query_data_request, QueryDataResponse, timeout=timeout, @@ -1454,7 +1564,7 @@ async def data_source( metadata: Optional["MetadataLike"] = None ) -> "QueryDataSourceResponse": return await self._unary_unary( - "/oracle.v1.Query/DataSource", + "/band.oracle.v1.Query/DataSource", query_data_source_request, QueryDataSourceResponse, timeout=timeout, @@ -1471,7 +1581,7 @@ async def oracle_script( metadata: Optional["MetadataLike"] = None ) -> "QueryOracleScriptResponse": return await self._unary_unary( - "/oracle.v1.Query/OracleScript", + "/band.oracle.v1.Query/OracleScript", query_oracle_script_request, QueryOracleScriptResponse, timeout=timeout, @@ -1488,7 +1598,7 @@ async def request( metadata: Optional["MetadataLike"] = None ) -> "QueryRequestResponse": return await self._unary_unary( - "/oracle.v1.Query/Request", + "/band.oracle.v1.Query/Request", query_request_request, QueryRequestResponse, timeout=timeout, @@ -1505,7 +1615,7 @@ async def pending_requests( metadata: Optional["MetadataLike"] = None ) -> "QueryPendingRequestsResponse": return await self._unary_unary( - "/oracle.v1.Query/PendingRequests", + "/band.oracle.v1.Query/PendingRequests", query_pending_requests_request, QueryPendingRequestsResponse, timeout=timeout, @@ -1522,7 +1632,7 @@ async def validator( metadata: Optional["MetadataLike"] = None ) -> "QueryValidatorResponse": return await self._unary_unary( - "/oracle.v1.Query/Validator", + "/band.oracle.v1.Query/Validator", query_validator_request, QueryValidatorResponse, timeout=timeout, @@ -1539,7 +1649,7 @@ async def is_reporter( metadata: Optional["MetadataLike"] = None ) -> "QueryIsReporterResponse": return await self._unary_unary( - "/oracle.v1.Query/IsReporter", + "/band.oracle.v1.Query/IsReporter", query_is_reporter_request, QueryIsReporterResponse, timeout=timeout, @@ -1556,7 +1666,7 @@ async def reporters( metadata: Optional["MetadataLike"] = None ) -> "QueryReportersResponse": return await self._unary_unary( - "/oracle.v1.Query/Reporters", + "/band.oracle.v1.Query/Reporters", query_reporters_request, QueryReportersResponse, timeout=timeout, @@ -1573,7 +1683,7 @@ async def active_validators( metadata: Optional["MetadataLike"] = None ) -> "QueryActiveValidatorsResponse": return await self._unary_unary( - "/oracle.v1.Query/ActiveValidators", + "/band.oracle.v1.Query/ActiveValidators", query_active_validators_request, QueryActiveValidatorsResponse, timeout=timeout, @@ -1590,7 +1700,7 @@ async def params( metadata: Optional["MetadataLike"] = None ) -> "QueryParamsResponse": return await self._unary_unary( - "/oracle.v1.Query/Params", + "/band.oracle.v1.Query/Params", query_params_request, QueryParamsResponse, timeout=timeout, @@ -1607,7 +1717,7 @@ async def request_search( metadata: Optional["MetadataLike"] = None ) -> "QueryRequestSearchResponse": return await self._unary_unary( - "/oracle.v1.Query/RequestSearch", + "/band.oracle.v1.Query/RequestSearch", query_request_search_request, QueryRequestSearchResponse, timeout=timeout, @@ -1624,7 +1734,7 @@ async def request_price( metadata: Optional["MetadataLike"] = None ) -> "QueryRequestPriceResponse": return await self._unary_unary( - "/oracle.v1.Query/RequestPrice", + "/band.oracle.v1.Query/RequestPrice", query_request_price_request, QueryRequestPriceResponse, timeout=timeout, @@ -1641,7 +1751,7 @@ async def request_verification( metadata: Optional["MetadataLike"] = None ) -> "QueryRequestVerificationResponse": return await self._unary_unary( - "/oracle.v1.Query/RequestVerification", + "/band.oracle.v1.Query/RequestVerification", query_request_verification_request, QueryRequestVerificationResponse, timeout=timeout, @@ -1674,6 +1784,9 @@ async def edit_oracle_script(self, msg_edit_oracle_script: "MsgEditOracleScript" async def activate(self, msg_activate: "MsgActivate") -> "MsgActivateResponse": 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_request_data( self, stream: "grpclib.server.Stream[MsgRequestData, MsgRequestDataResponse]" ) -> None: @@ -1723,50 +1836,63 @@ async def __rpc_activate(self, stream: "grpclib.server.Stream[MsgActivate, MsgAc response = await self.activate(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 { - "/oracle.v1.Msg/RequestData": grpclib.const.Handler( + "/band.oracle.v1.Msg/RequestData": grpclib.const.Handler( self.__rpc_request_data, grpclib.const.Cardinality.UNARY_UNARY, MsgRequestData, MsgRequestDataResponse, ), - "/oracle.v1.Msg/ReportData": grpclib.const.Handler( + "/band.oracle.v1.Msg/ReportData": grpclib.const.Handler( self.__rpc_report_data, grpclib.const.Cardinality.UNARY_UNARY, MsgReportData, MsgReportDataResponse, ), - "/oracle.v1.Msg/CreateDataSource": grpclib.const.Handler( + "/band.oracle.v1.Msg/CreateDataSource": grpclib.const.Handler( self.__rpc_create_data_source, grpclib.const.Cardinality.UNARY_UNARY, MsgCreateDataSource, MsgCreateDataSourceResponse, ), - "/oracle.v1.Msg/EditDataSource": grpclib.const.Handler( + "/band.oracle.v1.Msg/EditDataSource": grpclib.const.Handler( self.__rpc_edit_data_source, grpclib.const.Cardinality.UNARY_UNARY, MsgEditDataSource, MsgEditDataSourceResponse, ), - "/oracle.v1.Msg/CreateOracleScript": grpclib.const.Handler( + "/band.oracle.v1.Msg/CreateOracleScript": grpclib.const.Handler( self.__rpc_create_oracle_script, grpclib.const.Cardinality.UNARY_UNARY, MsgCreateOracleScript, MsgCreateOracleScriptResponse, ), - "/oracle.v1.Msg/EditOracleScript": grpclib.const.Handler( + "/band.oracle.v1.Msg/EditOracleScript": grpclib.const.Handler( self.__rpc_edit_oracle_script, grpclib.const.Cardinality.UNARY_UNARY, MsgEditOracleScript, MsgEditOracleScriptResponse, ), - "/oracle.v1.Msg/Activate": grpclib.const.Handler( + "/band.oracle.v1.Msg/Activate": grpclib.const.Handler( self.__rpc_activate, grpclib.const.Cardinality.UNARY_UNARY, MsgActivate, MsgActivateResponse, ), + "/band.oracle.v1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), } @@ -1927,85 +2053,85 @@ async def __rpc_request_verification( def __mapping__(self) -> Dict[str, grpclib.const.Handler]: return { - "/oracle.v1.Query/Counts": grpclib.const.Handler( + "/band.oracle.v1.Query/Counts": grpclib.const.Handler( self.__rpc_counts, grpclib.const.Cardinality.UNARY_UNARY, QueryCountsRequest, QueryCountsResponse, ), - "/oracle.v1.Query/Data": grpclib.const.Handler( + "/band.oracle.v1.Query/Data": grpclib.const.Handler( self.__rpc_data, grpclib.const.Cardinality.UNARY_UNARY, QueryDataRequest, QueryDataResponse, ), - "/oracle.v1.Query/DataSource": grpclib.const.Handler( + "/band.oracle.v1.Query/DataSource": grpclib.const.Handler( self.__rpc_data_source, grpclib.const.Cardinality.UNARY_UNARY, QueryDataSourceRequest, QueryDataSourceResponse, ), - "/oracle.v1.Query/OracleScript": grpclib.const.Handler( + "/band.oracle.v1.Query/OracleScript": grpclib.const.Handler( self.__rpc_oracle_script, grpclib.const.Cardinality.UNARY_UNARY, QueryOracleScriptRequest, QueryOracleScriptResponse, ), - "/oracle.v1.Query/Request": grpclib.const.Handler( + "/band.oracle.v1.Query/Request": grpclib.const.Handler( self.__rpc_request, grpclib.const.Cardinality.UNARY_UNARY, QueryRequestRequest, QueryRequestResponse, ), - "/oracle.v1.Query/PendingRequests": grpclib.const.Handler( + "/band.oracle.v1.Query/PendingRequests": grpclib.const.Handler( self.__rpc_pending_requests, grpclib.const.Cardinality.UNARY_UNARY, QueryPendingRequestsRequest, QueryPendingRequestsResponse, ), - "/oracle.v1.Query/Validator": grpclib.const.Handler( + "/band.oracle.v1.Query/Validator": grpclib.const.Handler( self.__rpc_validator, grpclib.const.Cardinality.UNARY_UNARY, QueryValidatorRequest, QueryValidatorResponse, ), - "/oracle.v1.Query/IsReporter": grpclib.const.Handler( + "/band.oracle.v1.Query/IsReporter": grpclib.const.Handler( self.__rpc_is_reporter, grpclib.const.Cardinality.UNARY_UNARY, QueryIsReporterRequest, QueryIsReporterResponse, ), - "/oracle.v1.Query/Reporters": grpclib.const.Handler( + "/band.oracle.v1.Query/Reporters": grpclib.const.Handler( self.__rpc_reporters, grpclib.const.Cardinality.UNARY_UNARY, QueryReportersRequest, QueryReportersResponse, ), - "/oracle.v1.Query/ActiveValidators": grpclib.const.Handler( + "/band.oracle.v1.Query/ActiveValidators": grpclib.const.Handler( self.__rpc_active_validators, grpclib.const.Cardinality.UNARY_UNARY, QueryActiveValidatorsRequest, QueryActiveValidatorsResponse, ), - "/oracle.v1.Query/Params": grpclib.const.Handler( + "/band.oracle.v1.Query/Params": grpclib.const.Handler( self.__rpc_params, grpclib.const.Cardinality.UNARY_UNARY, QueryParamsRequest, QueryParamsResponse, ), - "/oracle.v1.Query/RequestSearch": grpclib.const.Handler( + "/band.oracle.v1.Query/RequestSearch": grpclib.const.Handler( self.__rpc_request_search, grpclib.const.Cardinality.UNARY_UNARY, QueryRequestSearchRequest, QueryRequestSearchResponse, ), - "/oracle.v1.Query/RequestPrice": grpclib.const.Handler( + "/band.oracle.v1.Query/RequestPrice": grpclib.const.Handler( self.__rpc_request_price, grpclib.const.Cardinality.UNARY_UNARY, QueryRequestPriceRequest, QueryRequestPriceResponse, ), - "/oracle.v1.Query/RequestVerification": grpclib.const.Handler( + "/band.oracle.v1.Query/RequestVerification": grpclib.const.Handler( self.__rpc_request_verification, grpclib.const.Cardinality.UNARY_UNARY, QueryRequestVerificationRequest, diff --git a/pyband/proto/band/restake/__init__.py b/pyband/proto/band/restake/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/restake/v1beta1/__init__.py b/pyband/proto/band/restake/v1beta1/__init__.py new file mode 100644 index 0000000..37dcef4 --- /dev/null +++ b/pyband/proto/band/restake/v1beta1/__init__.py @@ -0,0 +1,624 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/restake/v1beta1/genesis.proto, band/restake/v1beta1/query.proto, band/restake/v1beta1/tx.proto, band/restake/v1beta1/types.proto +# plugin: python-betterproto +# This file has been @generated + +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__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +@dataclass(eq=False, repr=False) +class Vault(betterproto.Message): + """Vault is used for tracking the status of the vaults.""" + + key: str = betterproto.string_field(1) + """key is the key of the vault.""" + + is_active: bool = betterproto.bool_field(2) + """is_active is the status of the vault""" + + +@dataclass(eq=False, repr=False) +class Lock(betterproto.Message): + """Lock is used to store lock information of each user on each vault.""" + + staker_address: str = betterproto.string_field(1) + """staker_address is the owner's address of the staker.""" + + key: str = betterproto.string_field(2) + """key is the key of the vault that this lock is locked to.""" + + power: str = betterproto.string_field(3) + """power is the number of locked power.""" + + +@dataclass(eq=False, repr=False) +class Stake(betterproto.Message): + """Stake is used to store staked coins of an address.""" + + staker_address: str = betterproto.string_field(1) + """staker_address is the address that this stake belongs to.""" + + coins: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """coins are the coins that the address has staked.""" + + +@dataclass(eq=False, repr=False) +class LockResponse(betterproto.Message): + """ + LockResponse is used as response of the query to show the power + that is locked by the vault for the user. + """ + + key: str = betterproto.string_field(1) + """key is the key of the vault that this lock belongs to.""" + + power: str = betterproto.string_field(2) + """power is the number of locked power.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState represents the initial state of the blockchain.""" + + params: "Params" = betterproto.message_field(1) + """params is all parameters of the module.""" + + vaults: List["Vault"] = betterproto.message_field(2) + """vaults is a list of vaults in the module.""" + + locks: List["Lock"] = betterproto.message_field(3) + """locks is a list of locks in the module.""" + + stakes: List["Stake"] = betterproto.message_field(4) + """stakes is a list of stakes in the module.""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params is the data structure that keeps the parameters.""" + + allowed_denoms: List[str] = betterproto.string_field(1) + """ + allowed_denoms is a list of denoms that the module allows to stake to get power. + """ + + +@dataclass(eq=False, repr=False) +class MsgStake(betterproto.Message): + """MsgStake is the request message type for staking coins.""" + + staker_address: str = betterproto.string_field(1) + """staker_address is the address that will stake the coins.""" + + coins: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """coins is the coins that will be staked.""" + + +@dataclass(eq=False, repr=False) +class MsgStakeResponse(betterproto.Message): + """MsgStakeResponse is the response message type for staking coins.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUnstake(betterproto.Message): + """MsgUnstake is the request message type for unstaking coins.""" + + staker_address: str = betterproto.string_field(1) + """staker_address is the address that will unstake the coins.""" + + coins: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """coins is the coins that will be unstaked.""" + + +@dataclass(eq=False, repr=False) +class MsgUnstakeResponse(betterproto.Message): + """MsgUnstakeResponse is the response message type for unstaking coins.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the transaction message to update parameters.""" + + authority: str = betterproto.string_field(1) + """authority is the address of the governance account.""" + + params: "Params" = betterproto.message_field(2) + """params is parameters to update.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse is the response type for the Msg/UpdateParams RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryVaultsRequest(betterproto.Message): + """ + QueryVaultsRequest represents the request type for the Query/Vaults RPC method. + """ + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(1) + ) + """pagination defines optional pagination parameters.""" + + +@dataclass(eq=False, repr=False) +class QueryVaultsResponse(betterproto.Message): + """ + QueryVaultsResponse represents the response type for the Query/Vaults RPC method. + """ + + vaults: List["Vault"] = betterproto.message_field(1) + """vaults is a list of vaults.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination defines pagination parameters in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryVaultRequest(betterproto.Message): + """ + QueryVaultRequest represents the request type for the Query/Vault RPC method. + """ + + key: str = betterproto.string_field(1) + """key is the key of the vault that want to query.""" + + +@dataclass(eq=False, repr=False) +class QueryVaultResponse(betterproto.Message): + """ + QueryVaultResponse represents the response type for the Query/Vault RPC method. + """ + + vault: "Vault" = betterproto.message_field(1) + """vault is a vault information.""" + + +@dataclass(eq=False, repr=False) +class QueryLocksRequest(betterproto.Message): + """ + QueryLocksRequest represents the request type for the Query/Locks RPC method. + """ + + staker_address: str = betterproto.string_field(1) + """staker_address is the target address to query locks.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = ( + betterproto.message_field(2) + ) + """pagination defines optional pagination parameters.""" + + +@dataclass(eq=False, repr=False) +class QueryLocksResponse(betterproto.Message): + """ + QueryLocksResponse represents the response type for the Query/Locks RPC method. + """ + + locks: List["LockResponse"] = betterproto.message_field(1) + """locks is a list of locks of the staker.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = ( + betterproto.message_field(2) + ) + """pagination defines pagination parameters in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryLockRequest(betterproto.Message): + """ + QueryLockRequest represents the request type for the Query/Lock RPC method. + """ + + staker_address: str = betterproto.string_field(1) + """staker_address is the target address to query lock.""" + + key: str = betterproto.string_field(2) + """key is the key of target vault to query lock.""" + + +@dataclass(eq=False, repr=False) +class QueryLockResponse(betterproto.Message): + """ + QueryLockResponse represents the response type for the Query/Lock RPC method. + """ + + lock: "LockResponse" = betterproto.message_field(1) + """lock is the lock of the staker and the vault.""" + + +@dataclass(eq=False, repr=False) +class QueryStakeRequest(betterproto.Message): + """ + QueryStakeRequest represents the request type for the Query/Stake RPC method. + """ + + staker_address: str = betterproto.string_field(1) + """staker_address is the target address used to query the stake.""" + + +@dataclass(eq=False, repr=False) +class QueryStakeResponse(betterproto.Message): + """ + QueryStakeResponse represents the response type for the Query/Stake RPC method. + """ + + stake: "Stake" = betterproto.message_field(1) + """stake is a stake information of the staker.""" + + +@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 are the parameters of the module.""" + + +class MsgStub(betterproto.ServiceStub): + async def stake( + self, + msg_stake: "MsgStake", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgStakeResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Msg/Stake", + msg_stake, + MsgStakeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def unstake( + self, + msg_unstake: "MsgUnstake", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUnstakeResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Msg/Unstake", + msg_unstake, + MsgUnstakeResponse, + 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( + "/band.restake.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def vaults( + self, + query_vaults_request: "QueryVaultsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVaultsResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Query/Vaults", + query_vaults_request, + QueryVaultsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def vault( + self, + query_vault_request: "QueryVaultRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVaultResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Query/Vault", + query_vault_request, + QueryVaultResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def locks( + self, + query_locks_request: "QueryLocksRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryLocksResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Query/Locks", + query_locks_request, + QueryLocksResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def lock( + self, + query_lock_request: "QueryLockRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryLockResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Query/Lock", + query_lock_request, + QueryLockResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def stake( + self, + query_stake_request: "QueryStakeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryStakeResponse": + return await self._unary_unary( + "/band.restake.v1beta1.Query/Stake", + query_stake_request, + QueryStakeResponse, + 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( + "/band.restake.v1beta1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def stake(self, msg_stake: "MsgStake") -> "MsgStakeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def unstake(self, msg_unstake: "MsgUnstake") -> "MsgUnstakeResponse": + 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_stake( + self, stream: "grpclib.server.Stream[MsgStake, MsgStakeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.stake(request) + await stream.send_message(response) + + async def __rpc_unstake( + self, stream: "grpclib.server.Stream[MsgUnstake, MsgUnstakeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.unstake(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 { + "/band.restake.v1beta1.Msg/Stake": grpclib.const.Handler( + self.__rpc_stake, + grpclib.const.Cardinality.UNARY_UNARY, + MsgStake, + MsgStakeResponse, + ), + "/band.restake.v1beta1.Msg/Unstake": grpclib.const.Handler( + self.__rpc_unstake, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUnstake, + MsgUnstakeResponse, + ), + "/band.restake.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def vaults( + self, query_vaults_request: "QueryVaultsRequest" + ) -> "QueryVaultsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def vault( + self, query_vault_request: "QueryVaultRequest" + ) -> "QueryVaultResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def locks( + self, query_locks_request: "QueryLocksRequest" + ) -> "QueryLocksResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def lock(self, query_lock_request: "QueryLockRequest") -> "QueryLockResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def stake( + self, query_stake_request: "QueryStakeRequest" + ) -> "QueryStakeResponse": + 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_vaults( + self, stream: "grpclib.server.Stream[QueryVaultsRequest, QueryVaultsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.vaults(request) + await stream.send_message(response) + + async def __rpc_vault( + self, stream: "grpclib.server.Stream[QueryVaultRequest, QueryVaultResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.vault(request) + await stream.send_message(response) + + async def __rpc_locks( + self, stream: "grpclib.server.Stream[QueryLocksRequest, QueryLocksResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.locks(request) + await stream.send_message(response) + + async def __rpc_lock( + self, stream: "grpclib.server.Stream[QueryLockRequest, QueryLockResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.lock(request) + await stream.send_message(response) + + async def __rpc_stake( + self, stream: "grpclib.server.Stream[QueryStakeRequest, QueryStakeResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.stake(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) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.restake.v1beta1.Query/Vaults": grpclib.const.Handler( + self.__rpc_vaults, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVaultsRequest, + QueryVaultsResponse, + ), + "/band.restake.v1beta1.Query/Vault": grpclib.const.Handler( + self.__rpc_vault, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVaultRequest, + QueryVaultResponse, + ), + "/band.restake.v1beta1.Query/Locks": grpclib.const.Handler( + self.__rpc_locks, + grpclib.const.Cardinality.UNARY_UNARY, + QueryLocksRequest, + QueryLocksResponse, + ), + "/band.restake.v1beta1.Query/Lock": grpclib.const.Handler( + self.__rpc_lock, + grpclib.const.Cardinality.UNARY_UNARY, + QueryLockRequest, + QueryLockResponse, + ), + "/band.restake.v1beta1.Query/Stake": grpclib.const.Handler( + self.__rpc_stake, + grpclib.const.Cardinality.UNARY_UNARY, + QueryStakeRequest, + QueryStakeResponse, + ), + "/band.restake.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/pyband/proto/band/rollingseed/__init__.py b/pyband/proto/band/rollingseed/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/rollingseed/v1beta1/__init__.py b/pyband/proto/band/rollingseed/v1beta1/__init__.py new file mode 100644 index 0000000..83621d4 --- /dev/null +++ b/pyband/proto/band/rollingseed/v1beta1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/rollingseed/v1beta1/genesis.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the rollingseed module's genesis state.""" + + pass diff --git a/pyband/proto/band/tss/__init__.py b/pyband/proto/band/tss/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/tss/v1beta1/__init__.py b/pyband/proto/band/tss/v1beta1/__init__.py new file mode 100644 index 0000000..ef770c6 --- /dev/null +++ b/pyband/proto/band/tss/v1beta1/__init__.py @@ -0,0 +1,1707 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/tss/v1beta1/genesis.proto, band/tss/v1beta1/originator.proto, band/tss/v1beta1/query.proto, band/tss/v1beta1/tss.proto, band/tss/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass +from datetime import datetime +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +import grpclib +from betterproto.grpc.grpclib_server import ServiceBase + +from ....cosmos.base.query import v1beta1 as __cosmos_base_query_v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +class SigningStatus(betterproto.Enum): + """ + SigningStatus is an enumeration of the possible statuses of a signing. + """ + + UNSPECIFIED = 0 + """ + SIGNING_STATUS_UNSPECIFIED is the status of a signing that has not been specified. + """ + + WAITING = 1 + """ + SIGNING_STATUS_WAITING is the status of a signing that is waiting to be signed in the protocol. + """ + + SUCCESS = 2 + """ + SIGNING_STATUS_SUCCESS is the status of a signing that has success in the protocol. + """ + + FALLEN = 3 + """ + SIGNING_STATUS_FALLEN is the status of a signing that has fallen out of the protocol. + """ + + +class GroupStatus(betterproto.Enum): + """GroupStatus is an enumeration of the possible statuses of a group.""" + + UNSPECIFIED = 0 + """ + GROUP_STATUS_UNSPECIFIED is the status of a group that has not been specified. + """ + + ROUND_1 = 1 + """ + GROUP_STATUS_ROUND_1 is the status of a group that is in the first round of the protocol. + """ + + ROUND_2 = 2 + """ + GROUP_STATUS_ROUND_2 is the status of a group that is in the second round of the protocol. + """ + + ROUND_3 = 3 + """ + GROUP_STATUS_ROUND_3 is the status of a group that is in the third round of the protocol. + """ + + ACTIVE = 4 + """ + GROUP_STATUS_ACTIVE is the status of a group that is actively participating in the protocol. + """ + + EXPIRED = 5 + """ + GROUP_STATUS_EXPIRED is the status of a group that has expired in the protocol. + """ + + FALLEN = 6 + """ + GROUP_STATUS_FALLEN is the status of a group that has fallen out of the protocol. + """ + + +class ComplaintStatus(betterproto.Enum): + """ComplaintStatus represents the status of a complaint.""" + + UNSPECIFIED = 0 + """ + COMPLAINT_STATUS_UNSPECIFIED represents an undefined status of the complaint. + """ + + SUCCESS = 1 + """COMPLAINT_STATUS_SUCCESS represents a successful complaint.""" + + FAILED = 2 + """COMPLAINT_STATUS_FAILED represents a failed complaint.""" + + +@dataclass(eq=False, repr=False) +class Group(betterproto.Message): + """ + Group is a type representing a participant group in a Distributed Key Generation or signing process. + """ + + id: int = betterproto.uint64_field(1) + """id is the unique identifier of the group.""" + + size: int = betterproto.uint64_field(2) + """size is the number of members in the group.""" + + threshold: int = betterproto.uint64_field(3) + """ + threshold is the minimum number of members needed to generate a valid signature. + """ + + pub_key: bytes = betterproto.bytes_field(4) + """ + pub_key is the public key generated by the group after successful completion of the DKG process. + """ + + status: "GroupStatus" = betterproto.enum_field(5) + """ + status represents the current stage of the group in the DKG or signing process. + """ + + created_height: int = betterproto.uint64_field(6) + """created_height is the block height when the group was created.""" + + module_owner: str = betterproto.string_field(7) + """module_owner is the module that creates this group.""" + + +@dataclass(eq=False, repr=False) +class GroupResult(betterproto.Message): + """ + GroupResult is a tss group result from querying tss group information. + """ + + group: "Group" = betterproto.message_field(1) + """group defines the group object containing group information.""" + + dkg_context: bytes = betterproto.bytes_field(2) + """dkg_context defines the DKG context data.""" + + members: List["Member"] = betterproto.message_field(3) + """members is the list of members in the group.""" + + round1_infos: List["Round1Info"] = betterproto.message_field(4) + """round1_infos is the list of Round 1 information.""" + + round2_infos: List["Round2Info"] = betterproto.message_field(5) + """round2_infos is the list of Round 2 information.""" + + complaints_with_status: List["ComplaintsWithStatus"] = betterproto.message_field(6) + """complaints_with_status is the list of complaints with status.""" + + confirms: List["Confirm"] = betterproto.message_field(7) + """confirms is the list of confirms.""" + + +@dataclass(eq=False, repr=False) +class Round1Info(betterproto.Message): + """ + Round1Info contains all necessary information for handling round 1 of the DKG process. + """ + + member_id: int = betterproto.uint64_field(1) + """member_id is the unique identifier of a group member.""" + + coefficient_commits: List[bytes] = betterproto.bytes_field(2) + """ + coefficients_commits is a list of commitments to the coefficients of the member's secret polynomial. + """ + + one_time_pub_key: bytes = betterproto.bytes_field(3) + """ + one_time_pub_key is the one-time public key used by the member to encrypt secret shares. + """ + + a0_signature: bytes = betterproto.bytes_field(4) + """ + a0_signature is the member's signature on the first coefficient of its secret polynomial. + """ + + one_time_signature: bytes = betterproto.bytes_field(5) + """ + one_time_signature is the member's signature on its one-time public key. + """ + + +@dataclass(eq=False, repr=False) +class Round2Info(betterproto.Message): + """ + Round2Info contains all necessary information for handling round 2 of the DKG process. + """ + + member_id: int = betterproto.uint64_field(1) + """member_id is the unique identifier of a group member.""" + + encrypted_secret_shares: List[bytes] = betterproto.bytes_field(2) + """ + encrypted_secret_shares is a list of secret shares encrypted under the public keys of other members. + """ + + +@dataclass(eq=False, repr=False) +class De(betterproto.Message): + """ + DE contains the public parts of a member's decryption and encryption keys. + """ + + pub_d: bytes = betterproto.bytes_field(1) + """pub_d is the public value of own commitment (D).""" + + pub_e: bytes = betterproto.bytes_field(2) + """pub_e is the public value of own commitment (E).""" + + +@dataclass(eq=False, repr=False) +class DeQueue(betterproto.Message): + """ + DEQueue is a simple queue data structure contains index of existing DE objects of each member. + """ + + head: int = betterproto.uint64_field(1) + """head is the current index of the first element in the queue.""" + + tail: int = betterproto.uint64_field(2) + """tail is the current index of the last element in the queue.""" + + +@dataclass(eq=False, repr=False) +class Signing(betterproto.Message): + """ + Signing contains all necessary information for handling a signing request. + """ + + id: int = betterproto.uint64_field(1) + """id is the unique identifier of the signing.""" + + current_attempt: int = betterproto.uint64_field(2) + """ + current_attempt is the latest round number that signing has been attempted. + """ + + group_id: int = betterproto.uint64_field(3) + """group_id is the unique identifier of the group.""" + + group_pub_key: bytes = betterproto.bytes_field(4) + """group_pub_key is the public key of the group that sign this message.""" + + message: bytes = betterproto.bytes_field(5) + """message is the message to be signed.""" + + group_pub_nonce: bytes = betterproto.bytes_field(6) + """ + group_pub_nonce is the public nonce generated by the group for this signing process. + """ + + signature: bytes = betterproto.bytes_field(7) + """signature is the group's signature on the message.""" + + status: "SigningStatus" = betterproto.enum_field(8) + """ + status represents the current stage of the signing in the signing process. + """ + + created_height: int = betterproto.uint64_field(9) + """created_height is the block height when the signing was created.""" + + created_timestamp: datetime = betterproto.message_field(10) + """ + created_timestamp is the block timestamp when the signing was created. + """ + + +@dataclass(eq=False, repr=False) +class SigningAttempt(betterproto.Message): + """ + SigningAttempt contains a member that has been assigned to and expiration block height of + the specific attempt. + """ + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the unique identifier of the signing.""" + + attempt: int = betterproto.uint64_field(2) + """attempt is the number of round that this signing has been attempted.""" + + expired_height: int = betterproto.uint64_field(3) + """ + expired_height is the block height when this signing attempt was expired. + """ + + assigned_members: List["AssignedMember"] = betterproto.message_field(4) + """ + assigned_members is a list of members assigned to the signing process. + """ + + +@dataclass(eq=False, repr=False) +class AssignedMember(betterproto.Message): + """ + AssignedMember is a type representing a member that has been assigned to a signing process. + """ + + member_id: int = betterproto.uint64_field(1) + """member_id is the unique identifier of the member.""" + + address: str = betterproto.string_field(2) + """member is the human-readable name of the member.""" + + pub_key: bytes = betterproto.bytes_field(3) + """pub_key is the public part of a member.""" + + pub_d: bytes = betterproto.bytes_field(4) + """pub_d is the public part of a member's decryption key.""" + + pub_e: bytes = betterproto.bytes_field(5) + """pub_e is the public part of a member's encryption key.""" + + binding_factor: bytes = betterproto.bytes_field(6) + """ + binding_factor is the binding factor of the member for the signing process. + """ + + pub_nonce: bytes = betterproto.bytes_field(7) + """pub_nonce is the public nonce of the member for the signing process.""" + + +@dataclass(eq=False, repr=False) +class PendingSignings(betterproto.Message): + """ + PendingSignings is a list of all signing processes that are currently pending. + """ + + signing_ids: List[int] = betterproto.uint64_field(1) + """signing_ids is a list of identifiers for the signing processes.""" + + +@dataclass(eq=False, repr=False) +class Member(betterproto.Message): + """Member is a type representing a member of the group.""" + + id: int = betterproto.uint64_field(1) + """id is the unique identifier of a member.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the group id of this member.""" + + address: str = betterproto.string_field(3) + """address is the address of the member.""" + + pub_key: bytes = betterproto.bytes_field(4) + """pub_key is the public key of the member.""" + + is_malicious: bool = betterproto.bool_field(5) + """ + is_malicious is a boolean flag indicating whether the member is considered malicious. + """ + + is_active: bool = betterproto.bool_field(6) + """ + is_active is a boolean flag indicating whether the member is currently active in the protocol. + """ + + +@dataclass(eq=False, repr=False) +class Confirm(betterproto.Message): + """ + Confirm is a message type used to confirm participation in the protocol. + """ + + member_id: int = betterproto.uint64_field(1) + """member_id is the unique identifier of a group member.""" + + own_pub_key_sig: bytes = betterproto.bytes_field(2) + """own_pub_key_sig is a signature over the member's own public key.""" + + +@dataclass(eq=False, repr=False) +class Complaint(betterproto.Message): + """ + Complaint is a message type used to issue a complaint against a member. + """ + + complainant: int = betterproto.uint64_field(1) + """complainant is the member issuing the complaint.""" + + respondent: int = betterproto.uint64_field(2) + """respondent is the member against whom the complaint is issued.""" + + key_sym: bytes = betterproto.bytes_field(3) + """ + key_sym is a symmetric key between respondent's private key and respondent's public key. + """ + + signature: bytes = betterproto.bytes_field(4) + """ + signature is the complaint signature that can do a symmetric key validation and complaint verification. + """ + + +@dataclass(eq=False, repr=False) +class ComplaintWithStatus(betterproto.Message): + """ + ComplaintWithStatus contains information about a complaint with its status. + """ + + complaint: "Complaint" = betterproto.message_field(1) + """complaint is the information about the complaint.""" + + complaint_status: "ComplaintStatus" = betterproto.enum_field(2) + """complaint_status is the status of the complaint.""" + + +@dataclass(eq=False, repr=False) +class ComplaintsWithStatus(betterproto.Message): + """ + ComplaintsWithStatus contains information about multiple complaints and their status from a single member. + """ + + member_id: int = betterproto.uint64_field(1) + """member_id is the identifier of the member filing the complaints.""" + + complaints_with_status: List["ComplaintWithStatus"] = betterproto.message_field(2) + """ + complaints_with_status is the list of complaints with their status from this member. + """ + + +@dataclass(eq=False, repr=False) +class PendingProcessGroups(betterproto.Message): + """ + PendingProcessGroups is a list of groups that are waiting to be processed. + """ + + group_ids: List[int] = betterproto.uint64_field(1) + """group_ids is a list of group IDs.""" + + +@dataclass(eq=False, repr=False) +class PendingProcessSignings(betterproto.Message): + """ + PendingProcessSignigns is a list of signings that are waiting to be processed. + """ + + signing_ids: List[int] = betterproto.uint64_field(1) + """signing_ids is a list of signing IDs.""" + + +@dataclass(eq=False, repr=False) +class PartialSignature(betterproto.Message): + """ + PartialSignature contains information about a member's partial signature. + """ + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the unique identifier of the signing.""" + + signing_attempt: int = betterproto.uint64_field(2) + """signing_attempt is the number of attempts for this signing.""" + + member_id: int = betterproto.uint64_field(3) + """ + member_id is the identifier of the member providing the partial signature. + """ + + signature: bytes = betterproto.bytes_field(4) + """signature is the partial signature provided by this member.""" + + +@dataclass(eq=False, repr=False) +class TextSignatureOrder(betterproto.Message): + """TextSignatureOrder defines a general text signature order.""" + + message: bytes = betterproto.bytes_field(1) + """message is the data that needs to be signed.""" + + +@dataclass(eq=False, repr=False) +class EvmSignature(betterproto.Message): + """EVMSignature defines a signature in the EVM format.""" + + r_address: bytes = betterproto.bytes_field(1) + """r_address is the address of the nonce for using in the contract.""" + + signature: bytes = betterproto.bytes_field(2) + """signature is the signature part for using in the contract.""" + + +@dataclass(eq=False, repr=False) +class SigningResult(betterproto.Message): + """ + SigningResult is a tss signing result from querying tss signing information. + """ + + signing: "Signing" = betterproto.message_field(1) + """signing is the tss signing result.""" + + current_signing_attempt: "SigningAttempt" = betterproto.message_field(2) + """ + current_signing_attempt is the current attempt information of the signing. + """ + + evm_signature: "EvmSignature" = betterproto.message_field(3) + """ + evm_signature is the signature in the format that can use directly in EVM. + """ + + received_partial_signatures: List["PartialSignature"] = betterproto.message_field(4) + """ + received_partial_signatures is a list of received partial signatures. + """ + + +@dataclass(eq=False, repr=False) +class SigningExpiration(betterproto.Message): + """SigningExpiration defines the expiration time of the signing.""" + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the id of the signing.""" + + signing_attempt: int = betterproto.uint64_field(2) + """signing_attempt is the number of attempts of the signing.""" + + +@dataclass(eq=False, repr=False) +class SigningExpirations(betterproto.Message): + """ + SigningExpirations is a list of signing expiration information that are waiting in the queue. + """ + + signing_expirations: List["SigningExpiration"] = betterproto.message_field(1) + """signing_expirations is a list of SigningExpiration object.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the tss module's genesis state.""" + + params: "Params" = betterproto.message_field(1) + """params defines all the paramiters of the module.""" + + groups: List["Group"] = betterproto.message_field(2) + """groups is an array containing information about each group.""" + + members: List["Member"] = betterproto.message_field(3) + """ + members is an array containing information about each member of groups. + """ + + des: List["DeGenesis"] = betterproto.message_field(4) + """des is an array containing the des of all the addressres.""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """Params defines the set of module parameters.""" + + max_group_size: int = betterproto.uint64_field(1) + """max_group_size is the maximum of the member capacity of the group.""" + + max_de_size: int = betterproto.uint64_field(2) + """max_de_size is the maximum of the de capacity of the member.""" + + creation_period: int = betterproto.uint64_field(3) + """ + creation_period is the number of blocks allowed to creating tss group. + """ + + signing_period: int = betterproto.uint64_field(4) + """signing_period is the number of blocks allowed to sign.""" + + max_signing_attempt: int = betterproto.uint64_field(5) + """ + max_signing_attempt is the maximum number of signing retry process per signingID. + """ + + max_memo_length: int = betterproto.uint64_field(6) + """ + max_memo_length is the maximum length of the memo in the direct originator. + """ + + max_message_length: int = betterproto.uint64_field(7) + """ + max_message_length is the maximum length of the message in the TextSignatureOrder. + """ + + +@dataclass(eq=False, repr=False) +class DeGenesis(betterproto.Message): + """ + DEGenesis defines an account address and de pair used in the tss module's genesis state. + """ + + address: str = betterproto.string_field(1) + """address is the address of the de holder.""" + + de: "De" = betterproto.message_field(2) + """de defines the difference de this balance holds.""" + + +@dataclass(eq=False, repr=False) +class MsgSubmitDkgRound1(betterproto.Message): + """MsgSubmitDKGRound1 is the Msg/MsgSubmitDKGRound1 request type.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is ID of the group.""" + + round1_info: "Round1Info" = betterproto.message_field(2) + """round1_info is all data that require to handle round 1.""" + + sender: str = betterproto.string_field(3) + """ + sender is the user address that submits the group creation information; + must be a member of this group. + """ + + +@dataclass(eq=False, repr=False) +class MsgSubmitDkgRound1Response(betterproto.Message): + """MsgSubmitDKGRound1Response is the Msg/SubmitDKGRound1 response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgSubmitDkgRound2(betterproto.Message): + """MsgSubmitDKGRound2 is the Msg/SubmitDKGRound2 request type.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is ID of the group.""" + + round2_info: "Round2Info" = betterproto.message_field(2) + """round2_info is all data that is required to handle round 2.""" + + sender: str = betterproto.string_field(3) + """ + sender is the user address that submits the group creation information; + must be a member of this group. + """ + + +@dataclass(eq=False, repr=False) +class MsgSubmitDkgRound2Response(betterproto.Message): + """ + MsgSubmitDKGRound2Response is response data for MsgSubmitDKGRound2 message + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgComplain(betterproto.Message): + """ + MsgComplain is a message used to complain about malicious actors in the group. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is ID of the group.""" + + complaints: List["Complaint"] = betterproto.message_field(2) + """complaints is a list of complaints.""" + + sender: str = betterproto.string_field(3) + """ + sender is the user address that submits the group creation information; + must be a member of this group. + """ + + +@dataclass(eq=False, repr=False) +class MsgComplainResponse(betterproto.Message): + """MsgComplainResponse is response data for MsgComplain message""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgConfirm(betterproto.Message): + """MsgConfirm is a message used to confirm own public key.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is ID of the group.""" + + member_id: int = betterproto.uint64_field(2) + """member_id is ID of the sender.""" + + own_pub_key_sig: bytes = betterproto.bytes_field(3) + """ + own_pub_key_sig is a signature of the member_i on its own PubKey to confirm + that the address is able to derive the PubKey. + """ + + sender: str = betterproto.string_field(4) + """ + sender is the user address that submits the group creation information; + must be a member of this group. + """ + + +@dataclass(eq=False, repr=False) +class MsgConfirmResponse(betterproto.Message): + """MsgConfirmResponse is response data for MsgConfirm message""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgSubmitDEs(betterproto.Message): + """MsgSubmitDEs is a message used to submit a list of DEs.""" + + des: List["De"] = betterproto.message_field(1) + """des is a list of DE objects.""" + + sender: str = betterproto.string_field(2) + """sender is the user address that submits DE objects.""" + + +@dataclass(eq=False, repr=False) +class MsgSubmitDEsResponse(betterproto.Message): + """MsgSubmitDEsResponse is response data for MsgSubmitDEs message""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgResetDE(betterproto.Message): + """ + MsgResetDE is a message used to reset the DEs that being stored on chain. + """ + + sender: str = betterproto.string_field(1) + """sender is the user address that request for resetting DEs.""" + + +@dataclass(eq=False, repr=False) +class MsgResetDEResponse(betterproto.Message): + """MsgResetDEResponse is response data for MsgResetDE message""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgSubmitSignature(betterproto.Message): + """MsgSubmitSignature is a message used to submitting signature data.""" + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the unique identifier of the signing process.""" + + member_id: int = betterproto.uint64_field(2) + """member_id is the unique identifier of the signer in the group.""" + + signature: bytes = betterproto.bytes_field(3) + """signature is the signature produced by the signer.""" + + signer: str = betterproto.string_field(4) + """ + signer is the address who signs a message; must be a member of the group. + """ + + +@dataclass(eq=False, repr=False) +class MsgSubmitSignatureResponse(betterproto.Message): + """ + MsgSubmitSignatureResponse is response data for MsgSubmitSignature message + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the Msg/UpdateParams request type.""" + + params: "Params" = betterproto.message_field(1) + """params defines the x/tss parameters to update.""" + + authority: str = betterproto.string_field(2) + """authority is the address of the governance account.""" + + +@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 QueryCountsRequest(betterproto.Message): + """QueryCountsRequest is request type for the Query/Count RPC method.""" + + pass + + +@dataclass(eq=False, repr=False) +class QueryCountsResponse(betterproto.Message): + """QueryCountsResponse is response type for the Query/Count RPC method.""" + + group_count: int = betterproto.uint64_field(1) + """group_count is total number of group available on the chain""" + + signing_count: int = betterproto.uint64_field(2) + """ + signing_count is total number of signing request submitted to the chain + """ + + +@dataclass(eq=False, repr=False) +class QueryGroupRequest(betterproto.Message): + """QueryGroupRequest is the request type for the Query/Group RPC method""" + + group_id: int = betterproto.uint64_field(1) + """group_id defines the unique id of the group.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupResponse(betterproto.Message): + """ + QueryGroupResponse is the response type for the Query/Group RPC method + """ + + group_result: "GroupResult" = betterproto.message_field(1) + """group_result is the result of the group.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsRequest(betterproto.Message): + """ + QueryGroupsRequest is the request type for the Query/Groups RPC method + """ + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) + """pagination defines pagination settings for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsResponse(betterproto.Message): + """ + QueryGroupsResponse is the response type for the Query/Group RPC method + """ + + groups: List["GroupResult"] = betterproto.message_field(1) + """groups is the list of groups.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines an pagination for the response.""" + + +@dataclass(eq=False, repr=False) +class QueryMembersRequest(betterproto.Message): + """ + QueryMembersRequest is the request type for the Query/Members RPC method + """ + + group_id: int = betterproto.uint64_field(1) + """group_id defines the unique id of the group.""" + + +@dataclass(eq=False, repr=False) +class QueryMembersResponse(betterproto.Message): + """ + QueryMembersResponse is the response type for the Query/Members RPC method + """ + + members: List["Member"] = betterproto.message_field(1) + """members are member list of the group""" + + +@dataclass(eq=False, repr=False) +class QueryIsGranteeRequest(betterproto.Message): + """ + QueryIsSignerRequest is request type for the Query/IsGrantee RPC method. + """ + + granter: str = betterproto.string_field(1) + """granter is a granter address""" + + grantee: str = betterproto.string_field(2) + """grantee is a grantee address""" + + +@dataclass(eq=False, repr=False) +class QueryIsGranteeResponse(betterproto.Message): + """ + QueryIsGranteeResponse is response type for the Query/IsGrantee RPC method. + """ + + is_grantee: bool = betterproto.bool_field(1) + """is_grantee is true if this account has been granted by granter""" + + +@dataclass(eq=False, repr=False) +class QueryDeRequest(betterproto.Message): + """QueryDERequest is the request type for the Query/DE RPC method.""" + + address: str = betterproto.string_field(1) + """address is the address for the request.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines pagination settings for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryDeResponse(betterproto.Message): + """QueryDEResponse is the response type for the Query/DE RPC method.""" + + des: List["De"] = betterproto.message_field(1) + """des is a list of DEs.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines an pagination for the response.""" + + +@dataclass(eq=False, repr=False) +class QueryPendingGroupsRequest(betterproto.Message): + """ + QueryPendingGroupsRequest is the request type for the Query/PendingGroups RPC method. + """ + + address: str = betterproto.string_field(1) + """address is the address of the member.""" + + +@dataclass(eq=False, repr=False) +class QueryPendingGroupsResponse(betterproto.Message): + """ + QueryPendingGroupsResponse is the response type for the Query/PendingGroups RPC method. + """ + + pending_groups: List[int] = betterproto.uint64_field(1) + """pending_groups is a list of pending groups.""" + + +@dataclass(eq=False, repr=False) +class QueryPendingSigningsRequest(betterproto.Message): + """ + QueryPendingSigningsRequest is the request type for the Query/PendingSignings RPC method. + """ + + address: str = betterproto.string_field(1) + """address is the address of the member.""" + + +@dataclass(eq=False, repr=False) +class QueryPendingSigningsResponse(betterproto.Message): + """ + QueryPendingSigningsResponse is the response type for the Query/PendingSignings RPC method. + """ + + pending_signings: List[int] = betterproto.uint64_field(1) + """pending_signings is a list of pending signings.""" + + +@dataclass(eq=False, repr=False) +class QuerySigningRequest(betterproto.Message): + """ + QuerySigningRequest is the request type for the Query/Signing RPC method. + """ + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the ID of the signing request.""" + + +@dataclass(eq=False, repr=False) +class QuerySigningResponse(betterproto.Message): + """ + QuerySigningResponse is the response type for the Query/Signing RPC method. + """ + + signing_result: "SigningResult" = betterproto.message_field(1) + """signing_result is the result of the signing.""" + + +@dataclass(eq=False, repr=False) +class QuerySigningsRequest(betterproto.Message): + """ + QuerySigningsRequest is the request type for the Query/Signings RPC method. + """ + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) + """pagination defines pagination settings for the request.""" + + +@dataclass(eq=False, repr=False) +class QuerySigningsResponse(betterproto.Message): + """ + QuerySigningsResponse is the response type for the Query/Signings RPC method. + """ + + signing_results: List["SigningResult"] = betterproto.message_field(1) + """signing_results is a list of signing results.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines an pagination for the response.""" + + +@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 are the parameters of the module.""" + + +@dataclass(eq=False, repr=False) +class DirectOriginator(betterproto.Message): + """ + DirectOriginator is a message originator defines an information of the requester + on direct TSS request. + """ + + source_chain_id: str = betterproto.string_field(1) + """ + source_chain_id is the source chain ID that the data is originated from. + """ + + requester: str = betterproto.string_field(2) + """ + requester is the address of the requester, it can be the user address or module address. + """ + + memo: str = betterproto.string_field(3) + """memo is the note of the message.""" + + +@dataclass(eq=False, repr=False) +class TunnelOriginator(betterproto.Message): + """ + TunnelOriginator is a message originator defines an information of the requester + on TSS request via tunnel module. + """ + + source_chain_id: str = betterproto.string_field(1) + """ + source_chain_id is the source chain ID that the data is originated from. + """ + + tunnel_id: int = betterproto.uint64_field(2) + """tunnel_id is the tunnel ID that the request is originated from.""" + + destination_chain_id: str = betterproto.string_field(3) + """ + destination_chain_id is the destination chain ID that the data should be relayed to. + """ + + destination_contract_address: str = betterproto.string_field(4) + """ + destination_contract_address is the destination address that the data should be relayed to. + """ + + +class MsgStub(betterproto.ServiceStub): + async def submit_dkg_round1( + self, + msg_submit_dkg_round1: "MsgSubmitDkgRound1", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSubmitDkgRound1Response": + return await self._unary_unary( + "/band.tss.v1beta1.Msg/SubmitDKGRound1", + msg_submit_dkg_round1, + MsgSubmitDkgRound1Response, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def submit_dkg_round2( + self, + msg_submit_dkg_round2: "MsgSubmitDkgRound2", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSubmitDkgRound2Response": + return await self._unary_unary( + "/band.tss.v1beta1.Msg/SubmitDKGRound2", + msg_submit_dkg_round2, + MsgSubmitDkgRound2Response, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def complain( + self, + msg_complain: "MsgComplain", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgComplainResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Msg/Complain", + msg_complain, + MsgComplainResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def confirm( + self, + msg_confirm: "MsgConfirm", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgConfirmResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Msg/Confirm", + msg_confirm, + MsgConfirmResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def submit_d_es( + self, + msg_submit_d_es: "MsgSubmitDEs", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSubmitDEsResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Msg/SubmitDEs", + msg_submit_d_es, + MsgSubmitDEsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def reset_de( + self, + msg_reset_de: MsgResetDE, + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> MsgResetDEResponse: + return await self._unary_unary( + "/band.tss.v1beta1.Msg/ResetDE", + msg_reset_de, + MsgResetDEResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def submit_signature( + self, + msg_submit_signature: "MsgSubmitSignature", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSubmitSignatureResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Msg/SubmitSignature", + msg_submit_signature, + MsgSubmitSignatureResponse, + 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( + "/band.tss.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def counts( + self, + query_counts_request: "QueryCountsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryCountsResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/Counts", + query_counts_request, + QueryCountsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def groups( + self, + query_groups_request: "QueryGroupsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupsResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/Groups", + query_groups_request, + QueryGroupsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def group( + self, + query_group_request: "QueryGroupRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/Group", + query_group_request, + QueryGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def members( + self, + query_members_request: "QueryMembersRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryMembersResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/Members", + query_members_request, + QueryMembersResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def is_grantee( + self, + query_is_grantee_request: "QueryIsGranteeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryIsGranteeResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/IsGrantee", + query_is_grantee_request, + QueryIsGranteeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def de( + self, + query_de_request: "QueryDeRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryDeResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/DE", + query_de_request, + QueryDeResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def pending_groups( + self, + query_pending_groups_request: "QueryPendingGroupsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPendingGroupsResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/PendingGroups", + query_pending_groups_request, + QueryPendingGroupsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def pending_signings( + self, + query_pending_signings_request: "QueryPendingSigningsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPendingSigningsResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/PendingSignings", + query_pending_signings_request, + QueryPendingSigningsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def signing( + self, + query_signing_request: "QuerySigningRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySigningResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/Signing", + query_signing_request, + QuerySigningResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def signings( + self, + query_signings_request: "QuerySigningsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySigningsResponse": + return await self._unary_unary( + "/band.tss.v1beta1.Query/Signings", + query_signings_request, + QuerySigningsResponse, + 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( + "/band.tss.v1beta1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + async def submit_dkg_round1(self, msg_submit_dkg_round1: "MsgSubmitDkgRound1") -> "MsgSubmitDkgRound1Response": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def submit_dkg_round2(self, msg_submit_dkg_round2: "MsgSubmitDkgRound2") -> "MsgSubmitDkgRound2Response": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def complain(self, msg_complain: "MsgComplain") -> "MsgComplainResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def confirm(self, msg_confirm: "MsgConfirm") -> "MsgConfirmResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def submit_d_es(self, msg_submit_d_es: "MsgSubmitDEs") -> "MsgSubmitDEsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def reset_de(self, msg_reset_de: MsgResetDE) -> MsgResetDEResponse: + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def submit_signature(self, msg_submit_signature: "MsgSubmitSignature") -> "MsgSubmitSignatureResponse": + 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_submit_dkg_round1( + self, + stream: "grpclib.server.Stream[MsgSubmitDkgRound1, MsgSubmitDkgRound1Response]", + ) -> None: + request = await stream.recv_message() + response = await self.submit_dkg_round1(request) + await stream.send_message(response) + + async def __rpc_submit_dkg_round2( + self, + stream: "grpclib.server.Stream[MsgSubmitDkgRound2, MsgSubmitDkgRound2Response]", + ) -> None: + request = await stream.recv_message() + response = await self.submit_dkg_round2(request) + await stream.send_message(response) + + async def __rpc_complain(self, stream: "grpclib.server.Stream[MsgComplain, MsgComplainResponse]") -> None: + request = await stream.recv_message() + response = await self.complain(request) + await stream.send_message(response) + + async def __rpc_confirm(self, stream: "grpclib.server.Stream[MsgConfirm, MsgConfirmResponse]") -> None: + request = await stream.recv_message() + response = await self.confirm(request) + await stream.send_message(response) + + async def __rpc_submit_d_es(self, stream: "grpclib.server.Stream[MsgSubmitDEs, MsgSubmitDEsResponse]") -> None: + request = await stream.recv_message() + response = await self.submit_d_es(request) + await stream.send_message(response) + + async def __rpc_reset_de(self, stream: "grpclib.server.Stream[MsgResetDE, MsgResetDEResponse]") -> None: + request = await stream.recv_message() + response = await self.reset_de(request) + await stream.send_message(response) + + async def __rpc_submit_signature( + self, + stream: "grpclib.server.Stream[MsgSubmitSignature, MsgSubmitSignatureResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.submit_signature(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 { + "/band.tss.v1beta1.Msg/SubmitDKGRound1": grpclib.const.Handler( + self.__rpc_submit_dkg_round1, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitDkgRound1, + MsgSubmitDkgRound1Response, + ), + "/band.tss.v1beta1.Msg/SubmitDKGRound2": grpclib.const.Handler( + self.__rpc_submit_dkg_round2, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitDkgRound2, + MsgSubmitDkgRound2Response, + ), + "/band.tss.v1beta1.Msg/Complain": grpclib.const.Handler( + self.__rpc_complain, + grpclib.const.Cardinality.UNARY_UNARY, + MsgComplain, + MsgComplainResponse, + ), + "/band.tss.v1beta1.Msg/Confirm": grpclib.const.Handler( + self.__rpc_confirm, + grpclib.const.Cardinality.UNARY_UNARY, + MsgConfirm, + MsgConfirmResponse, + ), + "/band.tss.v1beta1.Msg/SubmitDEs": grpclib.const.Handler( + self.__rpc_submit_d_es, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitDEs, + MsgSubmitDEsResponse, + ), + "/band.tss.v1beta1.Msg/ResetDE": grpclib.const.Handler( + self.__rpc_reset_de, + grpclib.const.Cardinality.UNARY_UNARY, + MsgResetDE, + MsgResetDEResponse, + ), + "/band.tss.v1beta1.Msg/SubmitSignature": grpclib.const.Handler( + self.__rpc_submit_signature, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitSignature, + MsgSubmitSignatureResponse, + ), + "/band.tss.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + async def counts(self, query_counts_request: "QueryCountsRequest") -> "QueryCountsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def groups(self, query_groups_request: "QueryGroupsRequest") -> "QueryGroupsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def group(self, query_group_request: "QueryGroupRequest") -> "QueryGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def members(self, query_members_request: "QueryMembersRequest") -> "QueryMembersResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def is_grantee(self, query_is_grantee_request: "QueryIsGranteeRequest") -> "QueryIsGranteeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def de(self, query_de_request: "QueryDeRequest") -> "QueryDeResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def pending_groups( + self, query_pending_groups_request: "QueryPendingGroupsRequest" + ) -> "QueryPendingGroupsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def pending_signings( + self, query_pending_signings_request: "QueryPendingSigningsRequest" + ) -> "QueryPendingSigningsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def signing(self, query_signing_request: "QuerySigningRequest") -> "QuerySigningResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def signings(self, query_signings_request: "QuerySigningsRequest") -> "QuerySigningsResponse": + 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_counts(self, stream: "grpclib.server.Stream[QueryCountsRequest, QueryCountsResponse]") -> None: + request = await stream.recv_message() + response = await self.counts(request) + await stream.send_message(response) + + async def __rpc_groups(self, stream: "grpclib.server.Stream[QueryGroupsRequest, QueryGroupsResponse]") -> None: + request = await stream.recv_message() + response = await self.groups(request) + await stream.send_message(response) + + async def __rpc_group(self, stream: "grpclib.server.Stream[QueryGroupRequest, QueryGroupResponse]") -> None: + request = await stream.recv_message() + response = await self.group(request) + await stream.send_message(response) + + async def __rpc_members(self, stream: "grpclib.server.Stream[QueryMembersRequest, QueryMembersResponse]") -> None: + request = await stream.recv_message() + response = await self.members(request) + await stream.send_message(response) + + async def __rpc_is_grantee( + self, + stream: "grpclib.server.Stream[QueryIsGranteeRequest, QueryIsGranteeResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.is_grantee(request) + await stream.send_message(response) + + async def __rpc_de(self, stream: "grpclib.server.Stream[QueryDeRequest, QueryDeResponse]") -> None: + request = await stream.recv_message() + response = await self.de(request) + await stream.send_message(response) + + async def __rpc_pending_groups( + self, + stream: "grpclib.server.Stream[QueryPendingGroupsRequest, QueryPendingGroupsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.pending_groups(request) + await stream.send_message(response) + + async def __rpc_pending_signings( + self, + stream: "grpclib.server.Stream[QueryPendingSigningsRequest, QueryPendingSigningsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.pending_signings(request) + await stream.send_message(response) + + async def __rpc_signing(self, stream: "grpclib.server.Stream[QuerySigningRequest, QuerySigningResponse]") -> None: + request = await stream.recv_message() + response = await self.signing(request) + await stream.send_message(response) + + async def __rpc_signings( + self, + stream: "grpclib.server.Stream[QuerySigningsRequest, QuerySigningsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.signings(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) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.tss.v1beta1.Query/Counts": grpclib.const.Handler( + self.__rpc_counts, + grpclib.const.Cardinality.UNARY_UNARY, + QueryCountsRequest, + QueryCountsResponse, + ), + "/band.tss.v1beta1.Query/Groups": grpclib.const.Handler( + self.__rpc_groups, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupsRequest, + QueryGroupsResponse, + ), + "/band.tss.v1beta1.Query/Group": grpclib.const.Handler( + self.__rpc_group, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupRequest, + QueryGroupResponse, + ), + "/band.tss.v1beta1.Query/Members": grpclib.const.Handler( + self.__rpc_members, + grpclib.const.Cardinality.UNARY_UNARY, + QueryMembersRequest, + QueryMembersResponse, + ), + "/band.tss.v1beta1.Query/IsGrantee": grpclib.const.Handler( + self.__rpc_is_grantee, + grpclib.const.Cardinality.UNARY_UNARY, + QueryIsGranteeRequest, + QueryIsGranteeResponse, + ), + "/band.tss.v1beta1.Query/DE": grpclib.const.Handler( + self.__rpc_de, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDeRequest, + QueryDeResponse, + ), + "/band.tss.v1beta1.Query/PendingGroups": grpclib.const.Handler( + self.__rpc_pending_groups, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPendingGroupsRequest, + QueryPendingGroupsResponse, + ), + "/band.tss.v1beta1.Query/PendingSignings": grpclib.const.Handler( + self.__rpc_pending_signings, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPendingSigningsRequest, + QueryPendingSigningsResponse, + ), + "/band.tss.v1beta1.Query/Signing": grpclib.const.Handler( + self.__rpc_signing, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySigningRequest, + QuerySigningResponse, + ), + "/band.tss.v1beta1.Query/Signings": grpclib.const.Handler( + self.__rpc_signings, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySigningsRequest, + QuerySigningsResponse, + ), + "/band.tss.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/pyband/proto/band/tunnel/__init__.py b/pyband/proto/band/tunnel/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/band/tunnel/v1beta1/__init__.py b/pyband/proto/band/tunnel/v1beta1/__init__.py new file mode 100644 index 0000000..75ef3d7 --- /dev/null +++ b/pyband/proto/band/tunnel/v1beta1/__init__.py @@ -0,0 +1,1333 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: band/tunnel/v1beta1/genesis.proto, band/tunnel/v1beta1/params.proto, band/tunnel/v1beta1/query.proto, band/tunnel/v1beta1/route.proto, band/tunnel/v1beta1/tunnel.proto, band/tunnel/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +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 + +from ....cosmos.base import v1beta1 as __cosmos_base_v1_beta1__ +from ....cosmos.base.query import v1beta1 as __cosmos_base_query_v1_beta1__ +from ...feeds import v1beta1 as __feeds_v1_beta1__ + + +if TYPE_CHECKING: + import grpclib.server + from betterproto.grpc.grpclib_client import MetadataLike + from grpclib.metadata import Deadline + + +class TunnelStatusFilter(betterproto.Enum): + """TunnelStatusFilter defines a filter for tunnel status.""" + + UNSPECIFIED = 0 + """TUNNEL_STATUS_FILTER_UNSPECIFIED defines an unspecified status.""" + + ACTIVE = 1 + """TUNNEL_STATUS_FILTER_ACTIVE defines an active tunnel.""" + + INACTIVE = 2 + """TUNNEL_STATUS_FILTER_INACTIVE defines an inactive tunnel.""" + + +@dataclass(eq=False, repr=False) +class Params(betterproto.Message): + """ + Params is the data structure that keeps the parameters of the module. + """ + + min_deposit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """min_deposit is the minimum deposit required to create a tunnel.""" + + min_interval: int = betterproto.uint64_field(2) + """min_interval is the minimum interval in seconds.""" + + max_interval: int = betterproto.uint64_field(3) + """max_interval is the maximum interval in seconds.""" + + min_deviation_bps: int = betterproto.uint64_field(4) + """min_deviation_bps is the minimum deviation in basis points.""" + + max_deviation_bps: int = betterproto.uint64_field(5) + """max_deviation_bps is the maximum deviation in basis points.""" + + max_signals: int = betterproto.uint64_field(6) + """ + max_signals defines the maximum number of signals allowed per tunnel. + """ + + base_packet_fee: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(7) + """base_packet_fee is the base fee for each packet.""" + + +@dataclass(eq=False, repr=False) +class Tunnel(betterproto.Message): + """ + Tunnel contains the information of the tunnel that is created by the user + """ + + id: int = betterproto.uint64_field(1) + """id is the tunnel ID""" + + sequence: int = betterproto.uint64_field(2) + """sequence is representing the sequence of the tunnel packet.""" + + route: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(3) + """route is the route for delivering the signal prices""" + + fee_payer: str = betterproto.string_field(4) + """fee_payer is the address of the fee payer""" + + signal_deviations: List["SignalDeviation"] = betterproto.message_field(5) + """signal_deviations is the list of signal deviations""" + + interval: int = betterproto.uint64_field(6) + """interval is the interval for delivering the signal prices""" + + total_deposit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(7) + """total_deposit is the total deposit on the tunnel.""" + + is_active: bool = betterproto.bool_field(8) + """is_active is the flag to indicate if the tunnel is active""" + + created_at: int = betterproto.int64_field(9) + """created_at is the timestamp when the tunnel is created""" + + creator: str = betterproto.string_field(10) + """creator is the address of the creator""" + + +@dataclass(eq=False, repr=False) +class LatestPrices(betterproto.Message): + """LatestPrices is the type for prices that tunnel produces""" + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the tunnel ID""" + + prices: List["__feeds_v1_beta1__.Price"] = betterproto.message_field(2) + """prices is the list of prices information from feeds module.""" + + last_interval: int = betterproto.int64_field(3) + """ + last_interval is the last interval when the signal prices are produced by interval trigger + """ + + +@dataclass(eq=False, repr=False) +class TotalFees(betterproto.Message): + """TotalFees is the type for the total fees collected by the tunnel""" + + total_base_packet_fee: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(1) + """ + total_base_packet_fee is the total base packet fee collected by the tunnel + """ + + +@dataclass(eq=False, repr=False) +class Packet(betterproto.Message): + """Packet is the packet that tunnel produces""" + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the tunnel ID""" + + sequence: int = betterproto.uint64_field(2) + """sequence is representing the sequence of the tunnel packet.""" + + prices: List["__feeds_v1_beta1__.Price"] = betterproto.message_field(3) + """prices is the list of prices information from feeds module.""" + + receipt: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(4) + """ + receipt represents the confirmation of the packet delivery to the destination via the specified route. + """ + + created_at: int = betterproto.int64_field(5) + """created_at is the timestamp when the packet is created""" + + +@dataclass(eq=False, repr=False) +class Deposit(betterproto.Message): + """ + Deposit defines an amount deposited by an account address to the tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id defines the unique id of the tunnel.""" + + depositor: str = betterproto.string_field(2) + """depositor defines the deposit addresses from the proposals.""" + + amount: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(3) + """amount to be deposited by depositor.""" + + +@dataclass(eq=False, repr=False) +class SignalDeviation(betterproto.Message): + """ + SignalDeviation is the type for a signal with soft and hard deviation + """ + + signal_id: str = betterproto.string_field(1) + """signal_id is the signal ID""" + + soft_deviation_bps: int = betterproto.uint64_field(2) + """soft_deviation_bps is the soft deviation in basis points""" + + hard_deviation_bps: int = betterproto.uint64_field(3) + """hard_deviation_bps is the hard deviation in basis points""" + + +@dataclass(eq=False, repr=False) +class TunnelSignatureOrder(betterproto.Message): + """ + TunnelSignatureOrder defines a general signature order for sending signature to tss group. + """ + + sequence: int = betterproto.uint64_field(1) + """sequence is the sequence of the packet""" + + prices: List["__feeds_v1_beta1__.Price"] = betterproto.message_field(2) + """prices is the list of prices information from feeds module.""" + + created_at: int = betterproto.int64_field(3) + """created_at is the timestamp when the packet is created""" + + encoder: "__feeds_v1_beta1__.Encoder" = betterproto.enum_field(4) + """encoder is the mode of encoding data.""" + + +@dataclass(eq=False, repr=False) +class MsgCreateTunnel(betterproto.Message): + """MsgCreateTunnel is the transaction message to create a new tunnel.""" + + signal_deviations: List["SignalDeviation"] = betterproto.message_field(1) + """signal_deviations is the list of signal deviations.""" + + interval: int = betterproto.uint64_field(2) + """ + interval is the interval for delivering the signal prices in seconds. + """ + + route: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(3) + """route is the route for delivering the signal prices""" + + initial_deposit: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(4) + """ + initial_deposit is the deposit value that must be paid at tunnel creation. + """ + + creator: str = betterproto.string_field(5) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgCreateTunnelResponse(betterproto.Message): + """ + MsgCreateTunnelResponse is the response type for the Msg/CreateTunnel RPC method. + """ + + tunnel_id: int = betterproto.uint64_field(1) + + +@dataclass(eq=False, repr=False) +class MsgUpdateRoute(betterproto.Message): + """ + MsgUpdateRoute is the transaction message to update a route information of the tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to edit.""" + + route: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + """route is the route for delivering the signal prices""" + + creator: str = betterproto.string_field(3) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateRouteResponse(betterproto.Message): + """ + MsgUpdateRouteResponse is the response type for the Msg/UpdateRoute RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateSignalsAndInterval(betterproto.Message): + """ + MsgUpdateSignalsAndInterval is the transaction message to update signals and interval of the tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to edit.""" + + signal_deviations: List["SignalDeviation"] = betterproto.message_field(2) + """signal_deviations is the list of signal deviations.""" + + interval: int = betterproto.uint64_field(3) + """interval is the interval for delivering the signal prices.""" + + creator: str = betterproto.string_field(4) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateSignalsAndIntervalResponse(betterproto.Message): + """ + MsgUpdateSignalsAndIntervalResponse is the response type for the Msg/UpdateSignalsAndInterval RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgWithdrawFeePayerFunds(betterproto.Message): + """ + MsgWithdrawFeePayerFunds is the transaction message to withdraw fee payer funds to creator. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to withdraw fee payer coins.""" + + amount: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """amount is the coins to withdraw.""" + + creator: str = betterproto.string_field(3) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgWithdrawFeePayerFundsResponse(betterproto.Message): + """ + MsgWithdrawFeePayerFundsResponse is the response type for the Msg/WithdrawFeePayerFunds RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgActivateTunnel(betterproto.Message): + """MsgActivateTunnel is the transaction message to activate a tunnel.""" + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to activate.""" + + creator: str = betterproto.string_field(2) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgActivateTunnelResponse(betterproto.Message): + """ + MsgActivateTunnelResponse is the response type for the Msg/Activate RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgDeactivateTunnel(betterproto.Message): + """ + MsgDeactivateTunnel is the transaction message to deactivate a tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to deactivate.""" + + creator: str = betterproto.string_field(2) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgDeactivateTunnelResponse(betterproto.Message): + """ + MsgDeactivateTunnelResponse is the response type for the Msg/Deactivate RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgTriggerTunnel(betterproto.Message): + """ + MsgTriggerTunnel is the transaction message to manually trigger a tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to manually trigger.""" + + creator: str = betterproto.string_field(2) + """creator is the address of the creator.""" + + +@dataclass(eq=False, repr=False) +class MsgTriggerTunnelResponse(betterproto.Message): + """ + MsgTriggerTunnelResponse is the response type for the Msg/TriggerTunnel RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgDepositToTunnel(betterproto.Message): + """ + MsgDepositToTunnel defines a message to deposit to an existing tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id defines the unique id of the tunnel.""" + + amount: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """amount to be deposited by depositor.""" + + depositor: str = betterproto.string_field(3) + """depositor defines the deposit addresses from the tunnel.""" + + +@dataclass(eq=False, repr=False) +class MsgDepositToTunnelResponse(betterproto.Message): + """ + MsgDepositToTunnelResponse defines the Msg/DepositToTunnel response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgWithdrawFromTunnel(betterproto.Message): + """ + MsgWithdrawFromTunnel is the transaction message to withdraw a deposit from an existing tunnel. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id defines the unique id of the tunnel.""" + + amount: List["__cosmos_base_v1_beta1__.Coin"] = betterproto.message_field(2) + """amount to be withdrawn by withdrawer.""" + + withdrawer: str = betterproto.string_field(3) + """withdrawer defines the withdraw addresses from the tunnel.""" + + +@dataclass(eq=False, repr=False) +class MsgWithdrawFromTunnelResponse(betterproto.Message): + """ + MsgWithdrawFromTunnelResponse defines the Msg/WithdrawFromTunnel response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateParams(betterproto.Message): + """MsgUpdateParams is the transaction message to update parameters.""" + + authority: str = betterproto.string_field(1) + """authority is the address of the governance account.""" + + params: "Params" = betterproto.message_field(2) + """params is the x/tunnel parameters to update.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse is the response type for the Msg/UpdateParams RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class TssRoute(betterproto.Message): + """ + TSSRoute represents a route for TSS packets and implements the RouteI interface. + """ + + destination_chain_id: str = betterproto.string_field(1) + """destination_chain_id is the destination chain ID""" + + destination_contract_address: str = betterproto.string_field(2) + """destination_contract_address is the destination contract address""" + + encoder: "__feeds_v1_beta1__.Encoder" = betterproto.enum_field(3) + """encoder is the mode of encoding packet data.""" + + +@dataclass(eq=False, repr=False) +class TssPacketReceipt(betterproto.Message): + """ + TSSPacketReceipt represents a receipt for a TSS packet and implements the PacketReceiptI interface. + """ + + signing_id: int = betterproto.uint64_field(1) + """signing_id is the signing ID""" + + +@dataclass(eq=False, repr=False) +class IbcRoute(betterproto.Message): + """ + IBCRoute represents a route for IBC packets and implements the RouteI interface. + """ + + channel_id: str = betterproto.string_field(1) + """channel_id is the IBC channel ID""" + + +@dataclass(eq=False, repr=False) +class IbcPacketReceipt(betterproto.Message): + """ + IBCPacketReceipt represents a receipt for a IBC packet and implements the PacketReceiptI interface. + """ + + sequence: int = betterproto.uint64_field(1) + """sequence is representing the sequence of the IBC packet.""" + + +@dataclass(eq=False, repr=False) +class TunnelPricesPacketData(betterproto.Message): + """ + TunnelPricesPacketData represents the IBC packet payload for the tunnel packet. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the tunnel ID""" + + sequence: int = betterproto.uint64_field(2) + """sequence is representing the sequence of the tunnel packet.""" + + prices: List["__feeds_v1_beta1__.Price"] = betterproto.message_field(3) + """prices is the list of prices information from feeds module.""" + + created_at: int = betterproto.int64_field(4) + """created_at is the timestamp when the packet is created""" + + +@dataclass(eq=False, repr=False) +class QueryTunnelsRequest(betterproto.Message): + """ + QueryTunnelsRequest is the request type for the Query/Tunnels RPC method. + """ + + status_filter: "TunnelStatusFilter" = betterproto.enum_field(1) + """status_filter is a flag to filter tunnels by status.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryTunnelsResponse(betterproto.Message): + """ + QueryTunnelsResponse is the response type for the Query/Tunnels RPC method. + """ + + tunnels: List["Tunnel"] = betterproto.message_field(1) + """Tunnels is a list of tunnels.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines an optional pagination for the response.""" + + +@dataclass(eq=False, repr=False) +class QueryTunnelRequest(betterproto.Message): + """ + QueryTunnelRequest is the request type for the Query/Tunnel RPC method. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to query.""" + + +@dataclass(eq=False, repr=False) +class QueryTunnelResponse(betterproto.Message): + """ + QueryTunnelResponse is the response type for the Query/Tunnel RPC method. + """ + + tunnel: "Tunnel" = betterproto.message_field(1) + """tunnel is the tunnel with the given ID.""" + + +@dataclass(eq=False, repr=False) +class QueryDepositsRequest(betterproto.Message): + """ + QueryDepositsRequest is the request type for the Query/Deposits RPC method. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to query deposits.""" + + pagination: "__cosmos_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 is a list of deposits.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines an optional pagination for the response.""" + + +@dataclass(eq=False, repr=False) +class QueryDepositRequest(betterproto.Message): + """ + QueryDepositRequest is the request type for the Query/Deposit RPC method. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to query.""" + + depositor: str = betterproto.string_field(2) + """depositor is the address of the depositor to query.""" + + +@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 is the deposit with the given tunnel ID and depositor address. + """ + + +@dataclass(eq=False, repr=False) +class QueryPacketsRequest(betterproto.Message): + """ + QueryPacketsRequest is the request type for the Query/Packets RPC method. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to query packets.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryPacketsResponse(betterproto.Message): + """ + QueryPacketsResponse is the response type for the Query/Packets RPC method. + """ + + packets: List["Packet"] = betterproto.message_field(1) + """packets is a list of packets.""" + + pagination: "__cosmos_base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines an optional pagination for the response.""" + + +@dataclass(eq=False, repr=False) +class QueryPacketRequest(betterproto.Message): + """ + QueryPacketRequest is the request type for the Query/Packet RPC method. + """ + + tunnel_id: int = betterproto.uint64_field(1) + """tunnel_id is the ID of the tunnel to query packets.""" + + sequence: int = betterproto.uint64_field(2) + """sequence is the sequence of the packet to query.""" + + +@dataclass(eq=False, repr=False) +class QueryPacketResponse(betterproto.Message): + """ + QueryPacketResponse is the response type for the Query/Packet RPC method. + """ + + packet: "Packet" = betterproto.message_field(1) + """packet is the packet with the given tunnel ID and sequence.""" + + +@dataclass(eq=False, repr=False) +class QueryTotalFeesRequest(betterproto.Message): + """ + QueryTotalFeesRequest is the request type for the Query/TotalFees RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class QueryTotalFeesResponse(betterproto.Message): + """ + QueryTotalFeesResponse is the response type for the Query/TotalFees RPC method. + """ + + total_fees: "TotalFees" = betterproto.message_field(1) + """total_fees is the total fees collected by the tunnel.""" + + +@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 is the parameters of the module.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState represents the initial state of the blockchain.""" + + params: "Params" = betterproto.message_field(1) + """params is all parameters of the module.""" + + tunnel_count: int = betterproto.uint64_field(2) + """tunnel_count is the number of tunnels.""" + + tunnels: List["Tunnel"] = betterproto.message_field(3) + """tunnels is the list of tunnels.""" + + deposits: List["Deposit"] = betterproto.message_field(4) + """deposits is the list of deposits.""" + + total_fees: "TotalFees" = betterproto.message_field(5) + """total_fees is the type for the total fees collected by the tunnel""" + + +class MsgStub(betterproto.ServiceStub): + async def create_tunnel( + self, + msg_create_tunnel: "MsgCreateTunnel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCreateTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/CreateTunnel", + msg_create_tunnel, + MsgCreateTunnelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_route( + self, + msg_update_route: "MsgUpdateRoute", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateRouteResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/UpdateRoute", + msg_update_route, + MsgUpdateRouteResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_signals_and_interval( + self, + msg_update_signals_and_interval: "MsgUpdateSignalsAndInterval", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateSignalsAndIntervalResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/UpdateSignalsAndInterval", + msg_update_signals_and_interval, + MsgUpdateSignalsAndIntervalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def withdraw_fee_payer_funds( + self, + msg_withdraw_fee_payer_funds: "MsgWithdrawFeePayerFunds", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgWithdrawFeePayerFundsResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/WithdrawFeePayerFunds", + msg_withdraw_fee_payer_funds, + MsgWithdrawFeePayerFundsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def activate_tunnel( + self, + msg_activate_tunnel: "MsgActivateTunnel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgActivateTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/ActivateTunnel", + msg_activate_tunnel, + MsgActivateTunnelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def deactivate_tunnel( + self, + msg_deactivate_tunnel: "MsgDeactivateTunnel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgDeactivateTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/DeactivateTunnel", + msg_deactivate_tunnel, + MsgDeactivateTunnelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def trigger_tunnel( + self, + msg_trigger_tunnel: "MsgTriggerTunnel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgTriggerTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/TriggerTunnel", + msg_trigger_tunnel, + MsgTriggerTunnelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def deposit_to_tunnel( + self, + msg_deposit_to_tunnel: "MsgDepositToTunnel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgDepositToTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/DepositToTunnel", + msg_deposit_to_tunnel, + MsgDepositToTunnelResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def withdraw_from_tunnel( + self, + msg_withdraw_from_tunnel: "MsgWithdrawFromTunnel", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgWithdrawFromTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Msg/WithdrawFromTunnel", + msg_withdraw_from_tunnel, + MsgWithdrawFromTunnelResponse, + 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( + "/band.tunnel.v1beta1.Msg/UpdateParams", + msg_update_params, + MsgUpdateParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def tunnels( + self, + query_tunnels_request: "QueryTunnelsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTunnelsResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Query/Tunnels", + query_tunnels_request, + QueryTunnelsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def tunnel( + self, + query_tunnel_request: "QueryTunnelRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTunnelResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Query/Tunnel", + query_tunnel_request, + QueryTunnelResponse, + 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( + "/band.tunnel.v1beta1.Query/Deposits", + query_deposits_request, + QueryDepositsResponse, + 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( + "/band.tunnel.v1beta1.Query/Deposit", + query_deposit_request, + QueryDepositResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def packets( + self, + query_packets_request: "QueryPacketsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPacketsResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Query/Packets", + query_packets_request, + QueryPacketsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def packet( + self, + query_packet_request: "QueryPacketRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryPacketResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Query/Packet", + query_packet_request, + QueryPacketResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def total_fees( + self, + query_total_fees_request: "QueryTotalFeesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryTotalFeesResponse": + return await self._unary_unary( + "/band.tunnel.v1beta1.Query/TotalFees", + query_total_fees_request, + QueryTotalFeesResponse, + 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( + "/band.tunnel.v1beta1.Query/Params", + query_params_request, + QueryParamsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + async def create_tunnel(self, msg_create_tunnel: "MsgCreateTunnel") -> "MsgCreateTunnelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_route(self, msg_update_route: "MsgUpdateRoute") -> "MsgUpdateRouteResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_signals_and_interval( + self, msg_update_signals_and_interval: "MsgUpdateSignalsAndInterval" + ) -> "MsgUpdateSignalsAndIntervalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def withdraw_fee_payer_funds( + self, msg_withdraw_fee_payer_funds: "MsgWithdrawFeePayerFunds" + ) -> "MsgWithdrawFeePayerFundsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def activate_tunnel(self, msg_activate_tunnel: "MsgActivateTunnel") -> "MsgActivateTunnelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def deactivate_tunnel(self, msg_deactivate_tunnel: "MsgDeactivateTunnel") -> "MsgDeactivateTunnelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def trigger_tunnel(self, msg_trigger_tunnel: "MsgTriggerTunnel") -> "MsgTriggerTunnelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def deposit_to_tunnel(self, msg_deposit_to_tunnel: "MsgDepositToTunnel") -> "MsgDepositToTunnelResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def withdraw_from_tunnel( + self, msg_withdraw_from_tunnel: "MsgWithdrawFromTunnel" + ) -> "MsgWithdrawFromTunnelResponse": + 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_tunnel( + self, stream: "grpclib.server.Stream[MsgCreateTunnel, MsgCreateTunnelResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.create_tunnel(request) + await stream.send_message(response) + + async def __rpc_update_route( + self, stream: "grpclib.server.Stream[MsgUpdateRoute, MsgUpdateRouteResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.update_route(request) + await stream.send_message(response) + + async def __rpc_update_signals_and_interval( + self, + stream: "grpclib.server.Stream[MsgUpdateSignalsAndInterval, MsgUpdateSignalsAndIntervalResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_signals_and_interval(request) + await stream.send_message(response) + + async def __rpc_withdraw_fee_payer_funds( + self, + stream: "grpclib.server.Stream[MsgWithdrawFeePayerFunds, MsgWithdrawFeePayerFundsResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.withdraw_fee_payer_funds(request) + await stream.send_message(response) + + async def __rpc_activate_tunnel( + self, + stream: "grpclib.server.Stream[MsgActivateTunnel, MsgActivateTunnelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.activate_tunnel(request) + await stream.send_message(response) + + async def __rpc_deactivate_tunnel( + self, + stream: "grpclib.server.Stream[MsgDeactivateTunnel, MsgDeactivateTunnelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.deactivate_tunnel(request) + await stream.send_message(response) + + async def __rpc_trigger_tunnel( + self, + stream: "grpclib.server.Stream[MsgTriggerTunnel, MsgTriggerTunnelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.trigger_tunnel(request) + await stream.send_message(response) + + async def __rpc_deposit_to_tunnel( + self, + stream: "grpclib.server.Stream[MsgDepositToTunnel, MsgDepositToTunnelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.deposit_to_tunnel(request) + await stream.send_message(response) + + async def __rpc_withdraw_from_tunnel( + self, + stream: "grpclib.server.Stream[MsgWithdrawFromTunnel, MsgWithdrawFromTunnelResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.withdraw_from_tunnel(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 { + "/band.tunnel.v1beta1.Msg/CreateTunnel": grpclib.const.Handler( + self.__rpc_create_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCreateTunnel, + MsgCreateTunnelResponse, + ), + "/band.tunnel.v1beta1.Msg/UpdateRoute": grpclib.const.Handler( + self.__rpc_update_route, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateRoute, + MsgUpdateRouteResponse, + ), + "/band.tunnel.v1beta1.Msg/UpdateSignalsAndInterval": grpclib.const.Handler( + self.__rpc_update_signals_and_interval, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateSignalsAndInterval, + MsgUpdateSignalsAndIntervalResponse, + ), + "/band.tunnel.v1beta1.Msg/WithdrawFeePayerFunds": grpclib.const.Handler( + self.__rpc_withdraw_fee_payer_funds, + grpclib.const.Cardinality.UNARY_UNARY, + MsgWithdrawFeePayerFunds, + MsgWithdrawFeePayerFundsResponse, + ), + "/band.tunnel.v1beta1.Msg/ActivateTunnel": grpclib.const.Handler( + self.__rpc_activate_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgActivateTunnel, + MsgActivateTunnelResponse, + ), + "/band.tunnel.v1beta1.Msg/DeactivateTunnel": grpclib.const.Handler( + self.__rpc_deactivate_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgDeactivateTunnel, + MsgDeactivateTunnelResponse, + ), + "/band.tunnel.v1beta1.Msg/TriggerTunnel": grpclib.const.Handler( + self.__rpc_trigger_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgTriggerTunnel, + MsgTriggerTunnelResponse, + ), + "/band.tunnel.v1beta1.Msg/DepositToTunnel": grpclib.const.Handler( + self.__rpc_deposit_to_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgDepositToTunnel, + MsgDepositToTunnelResponse, + ), + "/band.tunnel.v1beta1.Msg/WithdrawFromTunnel": grpclib.const.Handler( + self.__rpc_withdraw_from_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + MsgWithdrawFromTunnel, + MsgWithdrawFromTunnelResponse, + ), + "/band.tunnel.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + } + + +class QueryBase(ServiceBase): + async def tunnels(self, query_tunnels_request: "QueryTunnelsRequest") -> "QueryTunnelsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def tunnel(self, query_tunnel_request: "QueryTunnelRequest") -> "QueryTunnelResponse": + 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 deposit(self, query_deposit_request: "QueryDepositRequest") -> "QueryDepositResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def packets(self, query_packets_request: "QueryPacketsRequest") -> "QueryPacketsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def packet(self, query_packet_request: "QueryPacketRequest") -> "QueryPacketResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def total_fees(self, query_total_fees_request: "QueryTotalFeesRequest") -> "QueryTotalFeesResponse": + 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_tunnels(self, stream: "grpclib.server.Stream[QueryTunnelsRequest, QueryTunnelsResponse]") -> None: + request = await stream.recv_message() + response = await self.tunnels(request) + await stream.send_message(response) + + async def __rpc_tunnel(self, stream: "grpclib.server.Stream[QueryTunnelRequest, QueryTunnelResponse]") -> None: + request = await stream.recv_message() + response = await self.tunnel(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_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_packets(self, stream: "grpclib.server.Stream[QueryPacketsRequest, QueryPacketsResponse]") -> None: + request = await stream.recv_message() + response = await self.packets(request) + await stream.send_message(response) + + async def __rpc_packet(self, stream: "grpclib.server.Stream[QueryPacketRequest, QueryPacketResponse]") -> None: + request = await stream.recv_message() + response = await self.packet(request) + await stream.send_message(response) + + async def __rpc_total_fees( + self, + stream: "grpclib.server.Stream[QueryTotalFeesRequest, QueryTotalFeesResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.total_fees(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) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/band.tunnel.v1beta1.Query/Tunnels": grpclib.const.Handler( + self.__rpc_tunnels, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTunnelsRequest, + QueryTunnelsResponse, + ), + "/band.tunnel.v1beta1.Query/Tunnel": grpclib.const.Handler( + self.__rpc_tunnel, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTunnelRequest, + QueryTunnelResponse, + ), + "/band.tunnel.v1beta1.Query/Deposits": grpclib.const.Handler( + self.__rpc_deposits, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDepositsRequest, + QueryDepositsResponse, + ), + "/band.tunnel.v1beta1.Query/Deposit": grpclib.const.Handler( + self.__rpc_deposit, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDepositRequest, + QueryDepositResponse, + ), + "/band.tunnel.v1beta1.Query/Packets": grpclib.const.Handler( + self.__rpc_packets, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPacketsRequest, + QueryPacketsResponse, + ), + "/band.tunnel.v1beta1.Query/Packet": grpclib.const.Handler( + self.__rpc_packet, + grpclib.const.Cardinality.UNARY_UNARY, + QueryPacketRequest, + QueryPacketResponse, + ), + "/band.tunnel.v1beta1.Query/TotalFees": grpclib.const.Handler( + self.__rpc_total_fees, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTotalFeesRequest, + QueryTotalFeesResponse, + ), + "/band.tunnel.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/pyband/proto/cosmos/app/__init__.py b/pyband/proto/cosmos/app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/app/runtime/__init__.py b/pyband/proto/cosmos/app/runtime/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/app/runtime/v1alpha1/__init__.py b/pyband/proto/cosmos/app/runtime/v1alpha1/__init__.py new file mode 100644 index 0000000..9796442 --- /dev/null +++ b/pyband/proto/cosmos/app/runtime/v1alpha1/__init__.py @@ -0,0 +1,86 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/app/runtime/v1alpha1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/app/v1alpha1/__init__.py b/pyband/proto/cosmos/app/v1alpha1/__init__.py new file mode 100644 index 0000000..b11c956 --- /dev/null +++ b/pyband/proto/cosmos/app/v1alpha1/__init__.py @@ -0,0 +1,248 @@ +# 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 +# This file has been @generated + +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 v1beta1, the framework knows how to migrate + from v1beta1 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.v1beta1. + 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.v1beta1.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.v1beta1.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 v1beta1 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/pyband/proto/cosmos/auth/module/__init__.py b/pyband/proto/cosmos/auth/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/auth/module/v1/__init__.py b/pyband/proto/cosmos/auth/module/v1/__init__.py new file mode 100644 index 0000000..4069b5f --- /dev/null +++ b/pyband/proto/cosmos/auth/module/v1/__init__.py @@ -0,0 +1,41 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/auth/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/auth/v1beta1/__init__.py b/pyband/proto/cosmos/auth/v1beta1/__init__.py index ec8b51d..b5f669c 100644 --- a/pyband/proto/cosmos/auth/v1beta1/__init__.py +++ b/pyband/proto/cosmos/auth/v1beta1/__init__.py @@ -1,6 +1,8 @@ # 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 +# This file has been @generated +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -26,9 +28,9 @@ @dataclass(eq=False, repr=False) class BaseAccount(betterproto.Message): """ - BaseAccount defines a base account type. It contains all the necessary - fields for basic account functionality. Any custom account type should - extend this type for additional functionality (e.g. vesting). + BaseAccount defines a base account type. It contains all the necessary fields + for basic account functionality. Any custom account type should extend this + type for additional functionality (e.g. vesting). """ address: str = betterproto.string_field(1) @@ -48,6 +50,26 @@ 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,11 +81,45 @@ 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): """ QueryAccountsRequest is the request type for the Query/Accounts RPC method. - Since: cosmos-sdk 0.43 + + Since: cosmos-sdk 0.43 """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) @@ -73,8 +129,9 @@ class QueryAccountsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryAccountsResponse(betterproto.Message): """ - QueryAccountsResponse is the response type for the Query/Accounts RPC - method. Since: cosmos-sdk 0.43 + QueryAccountsResponse is the response type for the Query/Accounts RPC method. + + Since: cosmos-sdk 0.43 """ accounts: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) @@ -123,17 +180,209 @@ 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): + """ + QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. + """ + + name: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class QueryModuleAccountByNameResponse(betterproto.Message): + """ + QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. + """ + + 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, @@ -169,6 +418,23 @@ async def account( metadata=metadata, ) + async def account_address_by_id( + self, + query_account_address_by_id_request: "QueryAccountAddressByIdRequest", + *, + 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", @@ -186,15 +452,184 @@ 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", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryModuleAccountByNameResponse": + return await self._unary_unary( + "/cosmos.auth.v1beta1.Query/ModuleAccountByName", + query_module_account_by_name_request, + QueryModuleAccountByNameResponse, + timeout=timeout, + deadline=deadline, + 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": + + async def accounts( + self, query_accounts_request: "QueryAccountsRequest" + ) -> "QueryAccountsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def account( + self, query_account_request: "QueryAccountRequest" + ) -> "QueryAccountResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def account_address_by_id( + self, query_account_address_by_id_request: "QueryAccountAddressByIdRequest" + ) -> "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 account(self, query_account_request: "QueryAccountRequest") -> "QueryAccountResponse": + async def module_accounts( + self, query_module_accounts_request: "QueryModuleAccountsRequest" + ) -> "QueryModuleAccountsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def params(self, query_params_request: "QueryParamsRequest") -> "QueryParamsResponse": + 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( @@ -205,16 +640,75 @@ async def __rpc_accounts( response = await self.accounts(request) await stream.send_message(response) - async def __rpc_account(self, stream: "grpclib.server.Stream[QueryAccountRequest, QueryAccountResponse]") -> None: + async def __rpc_account( + self, stream: "grpclib.server.Stream[QueryAccountRequest, QueryAccountResponse]" + ) -> None: request = await stream.recv_message() response = await self.account(request) await stream.send_message(response) - async def __rpc_params(self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]") -> None: + 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: request = await stream.recv_message() 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]", + ) -> None: + request = await stream.recv_message() + 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( @@ -229,10 +723,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/pyband/proto/cosmos/authz/module/__init__.py b/pyband/proto/cosmos/authz/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/authz/module/v1/__init__.py b/pyband/proto/cosmos/authz/module/v1/__init__.py new file mode 100644 index 0000000..752da60 --- /dev/null +++ b/pyband/proto/cosmos/authz/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/authz/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/authz/v1beta1/__init__.py b/pyband/proto/cosmos/authz/v1beta1/__init__.py index 852d908..7676d79 100644 --- a/pyband/proto/cosmos/authz/v1beta1/__init__.py +++ b/pyband/proto/cosmos/authz/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/authz/v1beta1/authz.proto, cosmos/authz/v1beta1/event.proto, cosmos/authz/v1beta1/genesis.proto, cosmos/authz/v1beta1/query.proto, cosmos/authz/v1beta1/tx.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from datetime import datetime from typing import ( @@ -28,32 +30,36 @@ class GenericAuthorization(betterproto.Message): """ GenericAuthorization gives the grantee unrestricted permissions to execute - the provided method on behalf of the granter's account. + the provided method on behalf of the granter's account. """ msg: str = betterproto.string_field(1) """ - Msg, identified by it's type URL, to grant unrestricted permissions to - execute + Msg, identified by it's type URL, to grant unrestricted permissions to execute """ @dataclass(eq=False, repr=False) class Grant(betterproto.Message): """ - Grant gives permissions to execute the provide method with expiration time. + Grant gives permissions to execute + the provide method with expiration time. """ 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 + GrantAuthorization extends a grant with both the addresses of the grantee and granter. + It is used in genesis.proto and query.proto """ granter: str = betterproto.string_field(1) @@ -62,11 +68,19 @@ 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 MsgGrant(betterproto.Message): """ - MsgGrant is a request type for Grant method. It declares authorization to - the grantee on behalf of the granter with the provided expiration time. + MsgGrant is a request type for Grant method. It declares authorization to the grantee + on behalf of the granter with the provided expiration time. """ granter: str = betterproto.string_field(1) @@ -75,41 +89,41 @@ 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) class MsgExec(betterproto.Message): """ - MsgExec attempts to execute the provided messages using authorizations - granted to the grantee. Each message should have only one signer - corresponding to the granter of the authorization. + MsgExec attempts to execute the provided messages using + authorizations granted to the grantee. Each message should have only + one signer corresponding to the granter of the authorization. """ 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) class MsgRevoke(betterproto.Message): """ MsgRevoke revokes any authorization with the provided sdk.Msg type on the - granter's account with that has been granted to the grantee. + granter's account with that has been granted to the grantee. """ granter: str = betterproto.string_field(1) @@ -134,8 +148,7 @@ class QueryGrantsRequest(betterproto.Message): grantee: str = betterproto.string_field(2) msg_type_url: str = betterproto.string_field(3) """ - Optional, msg_type_url, when set, will query only grants matching given msg - type. + Optional, msg_type_url, when set, will query only grants matching given msg type. """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(4) @@ -145,8 +158,7 @@ class QueryGrantsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryGrantsResponse(betterproto.Message): """ - QueryGrantsResponse is the response type for the Query/Authorizations RPC - method. + QueryGrantsResponse is the response type for the Query/Authorizations RPC method. """ grants: List["Grant"] = betterproto.message_field(1) @@ -159,8 +171,7 @@ class QueryGrantsResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryGranterGrantsRequest(betterproto.Message): """ - QueryGranterGrantsRequest is the request type for the Query/GranterGrants - RPC method. + QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. """ granter: str = betterproto.string_field(1) @@ -171,8 +182,7 @@ class QueryGranterGrantsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryGranterGrantsResponse(betterproto.Message): """ - QueryGranterGrantsResponse is the response type for the Query/GranterGrants - RPC method. + QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. """ grants: List["GrantAuthorization"] = betterproto.message_field(1) @@ -185,8 +195,7 @@ class QueryGranterGrantsResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryGranteeGrantsRequest(betterproto.Message): """ - QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants - RPC method. + QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. """ grantee: str = betterproto.string_field(1) @@ -197,8 +206,7 @@ class QueryGranteeGrantsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryGranteeGrantsResponse(betterproto.Message): """ - QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants - RPC method. + QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. """ grants: List["GrantAuthorization"] = betterproto.message_field(1) @@ -350,6 +358,7 @@ async def grantee_grants( class MsgBase(ServiceBase): + async def grant(self, msg_grant: "MsgGrant") -> "MsgGrantResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) @@ -359,17 +368,23 @@ async def exec(self, msg_exec: "MsgExec") -> "MsgExecResponse": async def revoke(self, msg_revoke: "MsgRevoke") -> "MsgRevokeResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_grant(self, stream: "grpclib.server.Stream[MsgGrant, MsgGrantResponse]") -> None: + async def __rpc_grant( + self, stream: "grpclib.server.Stream[MsgGrant, MsgGrantResponse]" + ) -> None: request = await stream.recv_message() response = await self.grant(request) await stream.send_message(response) - async def __rpc_exec(self, stream: "grpclib.server.Stream[MsgExec, MsgExecResponse]") -> None: + async def __rpc_exec( + self, stream: "grpclib.server.Stream[MsgExec, MsgExecResponse]" + ) -> None: request = await stream.recv_message() response = await self.exec(request) await stream.send_message(response) - async def __rpc_revoke(self, stream: "grpclib.server.Stream[MsgRevoke, MsgRevokeResponse]") -> None: + async def __rpc_revoke( + self, stream: "grpclib.server.Stream[MsgRevoke, MsgRevokeResponse]" + ) -> None: request = await stream.recv_message() response = await self.revoke(request) await stream.send_message(response) @@ -398,7 +413,10 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: class QueryBase(ServiceBase): - async def grants(self, query_grants_request: "QueryGrantsRequest") -> "QueryGrantsResponse": + + async def grants( + self, query_grants_request: "QueryGrantsRequest" + ) -> "QueryGrantsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def granter_grants( @@ -411,7 +429,9 @@ async def grantee_grants( ) -> "QueryGranteeGrantsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_grants(self, stream: "grpclib.server.Stream[QueryGrantsRequest, QueryGrantsResponse]") -> None: + async def __rpc_grants( + self, stream: "grpclib.server.Stream[QueryGrantsRequest, QueryGrantsResponse]" + ) -> None: request = await stream.recv_message() response = await self.grants(request) await stream.send_message(response) diff --git a/pyband/proto/cosmos/autocli/__init__.py b/pyband/proto/cosmos/autocli/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/autocli/v1/__init__.py b/pyband/proto/cosmos/autocli/v1/__init__.py new file mode 100644 index 0000000..437fbbd --- /dev/null +++ b/pyband/proto/cosmos/autocli/v1/__init__.py @@ -0,0 +1,250 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/autocli/v1beta1/options.proto, cosmos/autocli/v1beta1/query.proto +# plugin: python-betterproto +# This file has been @generated + +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.v1beta1.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.v1beta1.Query/AppOptions": grpclib.const.Handler( + self.__rpc_app_options, + grpclib.const.Cardinality.UNARY_UNARY, + AppOptionsRequest, + AppOptionsResponse, + ), + } diff --git a/pyband/proto/cosmos/bank/module/__init__.py b/pyband/proto/cosmos/bank/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/bank/module/v1/__init__.py b/pyband/proto/cosmos/bank/module/v1/__init__.py new file mode 100644 index 0000000..6dfa24e --- /dev/null +++ b/pyband/proto/cosmos/bank/module/v1/__init__.py @@ -0,0 +1,34 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/bank/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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. + """ + + restrictions_order: List[str] = betterproto.string_field(3) + """ + restrictions_order specifies the order of send restrictions and should be + a list of module names which provide a send restriction instance. If no + order is provided, then restrictions will be applied in alphabetical order + of module names. + """ diff --git a/pyband/proto/cosmos/bank/v1beta1/__init__.py b/pyband/proto/cosmos/bank/v1beta1/__init__.py index 1b3441a..86c9189 100644 --- a/pyband/proto/cosmos/bank/v1beta1/__init__.py +++ b/pyband/proto/cosmos/bank/v1beta1/__init__.py @@ -1,6 +1,8 @@ # 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 +# This file has been @generated +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -28,14 +30,27 @@ 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): """ SendEnabled maps coin denom to a send_enabled status (whether a denom is - sendable). + sendable). """ denom: str = betterproto.string_field(1) @@ -62,8 +77,8 @@ class Output(betterproto.Message): class Supply(betterproto.Message): """ Supply represents a struct that passively keeps track of the total supply - amounts in the network. This message is deprecated now that supply is - indexed by denom. + amounts in the network. + This message is deprecated now that supply is indexed by denom. """ total: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) @@ -76,8 +91,8 @@ def __post_init__(self) -> None: @dataclass(eq=False, repr=False) class DenomUnit(betterproto.Message): """ - DenomUnit represents a struct that describes a given denomination unit of - the basic token. + DenomUnit represents a struct that describes a given + denomination unit of the basic token. """ denom: str = betterproto.string_field(1) @@ -87,10 +102,11 @@ 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 - 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). + 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 = 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). """ aliases: List[str] = betterproto.string_field(3) @@ -99,7 +115,10 @@ class DenomUnit(betterproto.Message): @dataclass(eq=False, repr=False) class Metadata(betterproto.Message): - """Metadata represents a struct that describes a basic token.""" + """ + Metadata represents a struct that describes + a basic token. + """ description: str = betterproto.string_field(1) denom_units: List["DenomUnit"] = betterproto.message_field(2) @@ -112,18 +131,38 @@ class Metadata(betterproto.Message): display: str = betterproto.string_field(4) """ - display indicates the suggested denom that should be displayed in clients. + display indicates the suggested denom that should be + displayed in clients. """ name: str = betterproto.string_field(5) """ - name defines the name of the token (eg: Cosmos Atom) Since: cosmos-sdk 0.43 + name defines the name of the token (eg: Cosmos Atom) + + Since: cosmos-sdk 0.43 """ symbol: str = betterproto.string_field(6) """ symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - be the same as the display. Since: cosmos-sdk 0.43 + 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 """ @@ -152,6 +191,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 +206,77 @@ 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): """ @@ -188,8 +303,7 @@ class QueryBalanceResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryAllBalancesRequest(betterproto.Message): """ - QueryBalanceRequest is the request type for the Query/AllBalances RPC - method. + QueryBalanceRequest is the request type for the Query/AllBalances RPC method. """ address: str = betterproto.string_field(1) @@ -198,12 +312,19 @@ 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): """ QueryAllBalancesResponse is the response type for the Query/AllBalances RPC - method. + method. """ balances: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) @@ -216,8 +337,10 @@ class QueryAllBalancesResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QuerySpendableBalancesRequest(betterproto.Message): """ - QuerySpendableBalancesRequest defines the gRPC request structure for - querying an account's spendable balances. + QuerySpendableBalancesRequest defines the gRPC request structure for querying + an account's spendable balances. + + Since: cosmos-sdk 0.46 """ address: str = betterproto.string_field(1) @@ -230,8 +353,10 @@ class QuerySpendableBalancesRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QuerySpendableBalancesResponse(betterproto.Message): """ - QuerySpendableBalancesResponse defines the gRPC response structure for - querying an account's spendable balances. + QuerySpendableBalancesResponse defines the gRPC response structure for querying + an account's spendable balances. + + Since: cosmos-sdk 0.46 """ balances: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) @@ -241,17 +366,47 @@ 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): """ QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC - method. + method. """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) """ - pagination defines an optional pagination for the request. Since: cosmos- - sdk 0.43 + pagination defines an optional pagination for the request. + + Since: cosmos-sdk 0.43 """ @@ -259,7 +414,7 @@ class QueryTotalSupplyRequest(betterproto.Message): class QueryTotalSupplyResponse(betterproto.Message): """ QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC - method + method """ supply: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) @@ -267,7 +422,9 @@ class QueryTotalSupplyResponse(betterproto.Message): pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) """ - pagination defines the pagination in the response. Since: cosmos-sdk 0.43 + pagination defines the pagination in the response. + + Since: cosmos-sdk 0.43 """ @@ -284,8 +441,7 @@ class QuerySupplyOfRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QuerySupplyOfResponse(betterproto.Message): """ - QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC - method. + QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. """ amount: "__base_v1_beta1__.Coin" = betterproto.message_field(1) @@ -304,18 +460,17 @@ class QueryParamsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryParamsResponse(betterproto.Message): """ - QueryParamsResponse defines the response type for querying x/bank - parameters. + QueryParamsResponse defines the response type for querying x/bank parameters. """ params: "Params" = betterproto.message_field(1) + """params provides the parameters of the bank module.""" @dataclass(eq=False, repr=False) class QueryDenomsMetadataRequest(betterproto.Message): """ - QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata - RPC method. + QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) @@ -325,8 +480,8 @@ class QueryDenomsMetadataRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryDenomsMetadataResponse(betterproto.Message): """ - QueryDenomsMetadataResponse is the response type for the - Query/DenomsMetadata RPC method. + QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC + method. """ metadatas: List["Metadata"] = betterproto.message_field(1) @@ -341,8 +496,7 @@ class QueryDenomsMetadataResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryDenomMetadataRequest(betterproto.Message): """ - QueryDenomMetadataRequest is the request type for the Query/DenomMetadata - RPC method. + QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. """ denom: str = betterproto.string_field(1) @@ -352,14 +506,152 @@ class QueryDenomMetadataRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryDenomMetadataResponse(betterproto.Message): """ - QueryDenomMetadataResponse is the response type for the Query/DenomMetadata - RPC method. + QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC + method. + """ + + metadata: "Metadata" = betterproto.message_field(1) + """ + metadata describes and provides all the client information for the requested token. + """ + + +@dataclass(eq=False, repr=False) +class QueryDenomMetadataByQueryStringRequest(betterproto.Message): + """ + QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. + Identical with QueryDenomMetadataRequest but receives denom as query string. + """ + + 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. + 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. """ @@ -367,10 +659,19 @@ class QueryDenomMetadataResponse(betterproto.Message): 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 + 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) @@ -378,27 +679,33 @@ 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.""" supply: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) """ - supply represents the total supply. If it is left empty, then supply will - be calculated based on the provided balances. Otherwise, it will be used to - validate that the sum of the balances equals this amount. + supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. """ 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) class Balance(betterproto.Message): """ - Balance defines an account address and balance pair used in the bank - module's genesis state. + Balance defines an account address and balance pair used in the bank module's + genesis state. """ address: str = betterproto.string_field(1) @@ -443,6 +750,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 +837,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 +922,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,24 +956,107 @@ 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) - async def multi_send(self, msg_multi_send: "MsgMultiSend") -> "MsgMultiSendResponse": + async def multi_send( + self, msg_multi_send: "MsgMultiSend" + ) -> "MsgMultiSendResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_send(self, stream: "grpclib.server.Stream[MsgSend, MsgSendResponse]") -> None: + 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: request = await stream.recv_message() response = await self.send(request) await stream.send_message(response) - async def __rpc_multi_send(self, stream: "grpclib.server.Stream[MsgMultiSend, MsgMultiSendResponse]") -> None: + async def __rpc_multi_send( + self, stream: "grpclib.server.Stream[MsgMultiSend, MsgMultiSendResponse]" + ) -> None: request = await stream.recv_message() 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( @@ -613,14 +1071,31 @@ 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": + + async def balance( + self, query_balance_request: "QueryBalanceRequest" + ) -> "QueryBalanceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def all_balances(self, query_all_balances_request: "QueryAllBalancesRequest") -> "QueryAllBalancesResponse": + async def all_balances( + self, query_all_balances_request: "QueryAllBalancesRequest" + ) -> "QueryAllBalancesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def spendable_balances( @@ -628,13 +1103,25 @@ async def spendable_balances( ) -> "QuerySpendableBalancesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def total_supply(self, query_total_supply_request: "QueryTotalSupplyRequest") -> "QueryTotalSupplyResponse": + async def spendable_balance_by_denom( + self, + query_spendable_balance_by_denom_request: "QuerySpendableBalanceByDenomRequest", + ) -> "QuerySpendableBalanceByDenomResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def supply_of(self, query_supply_of_request: "QuerySupplyOfRequest") -> "QuerySupplyOfResponse": + async def total_supply( + self, query_total_supply_request: "QueryTotalSupplyRequest" + ) -> "QueryTotalSupplyResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def params(self, query_params_request: "QueryParamsRequest") -> "QueryParamsResponse": + async def supply_of( + self, query_supply_of_request: "QuerySupplyOfRequest" + ) -> "QuerySupplyOfResponse": + 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 denom_metadata( @@ -642,12 +1129,35 @@ 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 __rpc_balance(self, stream: "grpclib.server.Stream[QueryBalanceRequest, QueryBalanceResponse]") -> None: + 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: request = await stream.recv_message() response = await self.balance(request) await stream.send_message(response) @@ -668,6 +1178,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]", @@ -684,7 +1202,9 @@ async def __rpc_supply_of( response = await self.supply_of(request) await stream.send_message(response) - async def __rpc_params(self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]") -> None: + 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) @@ -697,6 +1217,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]", @@ -705,6 +1233,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( @@ -725,6 +1277,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, @@ -749,10 +1307,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/pyband/proto/cosmos/base/abci/v1beta1/__init__.py b/pyband/proto/cosmos/base/abci/v1beta1/__init__.py index 075f6d4..1a58c23 100644 --- a/pyband/proto/cosmos/base/abci/v1beta1/__init__.py +++ b/pyband/proto/cosmos/base/abci/v1beta1/__init__.py @@ -1,20 +1,25 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/base/abci/v1beta1/abci.proto # plugin: python-betterproto +# This file has been @generated +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) class TxResponse(betterproto.Message): """ - TxResponse defines a structure containing relevant tx data and metadata. - The tags are stringified and the log is JSON decoded. + TxResponse defines a structure containing relevant tx data and metadata. The + tags are stringified and the log is JSON decoded. """ height: int = betterproto.int64_field(1) @@ -34,8 +39,8 @@ class TxResponse(betterproto.Message): raw_log: str = betterproto.string_field(6) """ - The output of the application's logger (raw string). May be non- - deterministic. + The output of the application's logger (raw string). May be + non-deterministic. """ logs: List["AbciMessageLog"] = betterproto.message_field(7) @@ -58,25 +63,25 @@ class TxResponse(betterproto.Message): timestamp: str = betterproto.string_field(12) """ Time of the previous block. For heights > 1, it's the weighted median of - the timestamps of the valid votes in the block.LastCommit. For height == 1, - it's genesis time. + the timestamps of the valid votes in the block.LastCommit. For height == 1, + it's genesis time. """ - events: List["____tendermint_abci__.Event"] = betterproto.message_field(13) + events: List["__tendermint_abci__.Event"] = betterproto.message_field(13) """ 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 + these events include those emitted by processing all the messages and those + 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 """ @dataclass(eq=False, repr=False) class AbciMessageLog(betterproto.Message): """ - ABCIMessageLog defines a structure containing an indexed tx ABCI message - log. + ABCIMessageLog defines a structure containing an indexed tx ABCI message log. """ msg_index: int = betterproto.uint32_field(1) @@ -84,7 +89,7 @@ class AbciMessageLog(betterproto.Message): events: List["StringEvent"] = betterproto.message_field(3) """ Events contains a slice of Event objects that were emitted during some - execution. + execution. """ @@ -92,7 +97,7 @@ class AbciMessageLog(betterproto.Message): class StringEvent(betterproto.Message): """ StringEvent defines en Event object wrapper where all the attributes - contain key/value pairs that are strings instead of raw bytes. + contain key/value pairs that are strings instead of raw bytes. """ type: str = betterproto.string_field(1) @@ -102,8 +107,8 @@ class StringEvent(betterproto.Message): @dataclass(eq=False, repr=False) class Attribute(betterproto.Message): """ - Attribute defines an attribute wrapper where the key and value are strings - instead of raw bytes. + Attribute defines an attribute wrapper where the key and value are + strings instead of raw bytes. """ key: str = betterproto.string_field(1) @@ -128,24 +133,40 @@ class Result(betterproto.Message): data: bytes = betterproto.bytes_field(1) """ Data is any data returned from message or handler execution. It MUST be - length prefixed in order to separate data from multiple message executions. + 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) """Log contains the log information from message or handler execution.""" - events: List["____tendermint_abci__.Event"] = betterproto.message_field(3) + events: List["__tendermint_abci__.Event"] = betterproto.message_field(3) """ Events contains a slice of Event objects that were emitted during message - or handler execution. + 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): """ SimulationResponse defines the response generated when a transaction is - successfully simulated. + successfully simulated. """ gas_info: "GasInfo" = betterproto.message_field(1) @@ -156,21 +177,40 @@ class SimulationResponse(betterproto.Message): class MsgData(betterproto.Message): """ MsgData defines the data returned in a Result object during message - execution. + execution. """ 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): """ - TxMsgData defines a list of MsgData. A transaction will have a MsgData - object for each message. + TxMsgData defines a list of MsgData. A transaction will have a MsgData object + for each 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 +234,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/pyband/proto/cosmos/base/node/__init__.py b/pyband/proto/cosmos/base/node/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/base/node/v1beta1/__init__.py b/pyband/proto/cosmos/base/node/v1beta1/__init__.py new file mode 100644 index 0000000..2057812 --- /dev/null +++ b/pyband/proto/cosmos/base/node/v1beta1/__init__.py @@ -0,0 +1,138 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/base/node/v1beta1/query.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass +from datetime import datetime +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 ConfigRequest(betterproto.Message): + """ + ConfigRequest defines the request structure for the Config gRPC query. + """ + + pass + + +@dataclass(eq=False, repr=False) +class ConfigResponse(betterproto.Message): + """ + ConfigResponse defines the response structure for the Config gRPC query. + """ + + 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): + async def config( + self, + config_request: "ConfigRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ConfigResponse": + return await self._unary_unary( + "/cosmos.base.node.v1beta1.Service/Config", + config_request, + ConfigResponse, + timeout=timeout, + deadline=deadline, + 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: + request = await stream.recv_message() + 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( + self.__rpc_config, + grpclib.const.Cardinality.UNARY_UNARY, + ConfigRequest, + ConfigResponse, + ), + "/cosmos.base.node.v1beta1.Service/Status": grpclib.const.Handler( + self.__rpc_status, + grpclib.const.Cardinality.UNARY_UNARY, + StatusRequest, + StatusResponse, + ), + } diff --git a/pyband/proto/cosmos/base/query/v1beta1/__init__.py b/pyband/proto/cosmos/base/query/v1beta1/__init__.py index a0e406d..41af99a 100644 --- a/pyband/proto/cosmos/base/query/v1beta1/__init__.py +++ b/pyband/proto/cosmos/base/query/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/base/query/v1beta1/pagination.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto @@ -10,40 +12,47 @@ class PageRequest(betterproto.Message): """ PageRequest is to be embedded in gRPC request messages for efficient - pagination. Ex: message SomeRequest { Foo some_parameter = 1; - PageRequest pagination = 2; } + pagination. Ex: + + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } """ key: bytes = betterproto.bytes_field(1) """ - key is a value returned in PageResponse.next_key to begin querying the next - page most efficiently. Only one of offset or key should be set. + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. """ offset: int = betterproto.uint64_field(2) """ - offset is a numeric offset that can be used when key is unavailable. It is - less efficient than using key. Only one of offset or key should be set. + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. """ limit: int = betterproto.uint64_field(3) """ - 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. + 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. """ count_total: bool = betterproto.bool_field(4) """ count_total is set to true to indicate that the result set should include - a count of the total number of items available for pagination in UIs. - count_total is only respected when offset is used. It is ignored when key - is set. + a count of the total number of items available for pagination in UIs. + count_total is only respected when offset is used. It is ignored when key + is set. """ reverse: bool = betterproto.bool_field(5) """ - reverse is set to true if results are to be returned in the descending - order. Since: cosmos-sdk 0.43 + reverse is set to true if results are to be returned in the descending order. + + Since: cosmos-sdk 0.43 """ @@ -51,18 +60,23 @@ class PageRequest(betterproto.Message): class PageResponse(betterproto.Message): """ PageResponse is to be embedded in gRPC response messages where the - corresponding request message has used PageRequest. message SomeResponse { - repeated Bar results = 1; PageResponse page = 2; } + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } """ 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 + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. """ total: int = betterproto.uint64_field(2) """ - total is total number of results available if PageRequest.count_total was - set, its value is undefined otherwise + total is total number of results available if PageRequest.count_total + was set, its value is undefined otherwise """ diff --git a/pyband/proto/cosmos/base/reflection/v1beta1/__init__.py b/pyband/proto/cosmos/base/reflection/v1beta1/__init__.py index a038e99..44330fb 100644 --- a/pyband/proto/cosmos/base/reflection/v1beta1/__init__.py +++ b/pyband/proto/cosmos/base/reflection/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/base/reflection/v1beta1/reflection.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -32,8 +34,7 @@ class ListAllInterfacesRequest(betterproto.Message): @dataclass(eq=False, repr=False) class ListAllInterfacesResponse(betterproto.Message): """ - ListAllInterfacesResponse is the response type of the ListAllInterfaces - RPC. + ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. """ interface_names: List[str] = betterproto.string_field(1) @@ -44,7 +45,7 @@ class ListAllInterfacesResponse(betterproto.Message): class ListImplementationsRequest(betterproto.Message): """ ListImplementationsRequest is the request type of the ListImplementations - RPC. + RPC. """ interface_name: str = betterproto.string_field(1) @@ -57,7 +58,7 @@ class ListImplementationsRequest(betterproto.Message): class ListImplementationsResponse(betterproto.Message): """ ListImplementationsResponse is the response type of the ListImplementations - RPC. + RPC. """ implementation_message_names: List[str] = betterproto.string_field(1) @@ -100,6 +101,7 @@ async def list_implementations( class ReflectionServiceBase(ServiceBase): + async def list_all_interfaces( self, list_all_interfaces_request: "ListAllInterfacesRequest" ) -> "ListAllInterfacesResponse": diff --git a/pyband/proto/cosmos/base/reflection/v2alpha1/__init__.py b/pyband/proto/cosmos/base/reflection/v2alpha1/__init__.py index 19bdd9b..808d64f 100644 --- a/pyband/proto/cosmos/base/reflection/v2alpha1/__init__.py +++ b/pyband/proto/cosmos/base/reflection/v2alpha1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/base/reflection/v2alpha1/reflection.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -26,9 +28,8 @@ class AppDescriptor(betterproto.Message): authn: "AuthnDescriptor" = betterproto.message_field(1) """ - AuthnDescriptor provides information on how to authenticate transactions on - the application NOTE: experimental and subject to change in future - releases. + AuthnDescriptor provides information on how to authenticate transactions on the application + NOTE: experimental and subject to change in future releases. """ chain: "ChainDescriptor" = betterproto.message_field(2) @@ -44,14 +45,12 @@ class AppDescriptor(betterproto.Message): query_services: "QueryServicesDescriptor" = betterproto.message_field(5) """ - query_services provides metadata information regarding the available - queriable endpoints + query_services provides metadata information regarding the available queriable endpoints """ tx: "TxDescriptor" = betterproto.message_field(6) """ - tx provides metadata information regarding how to send transactions to the - given application + tx provides metadata information regarding how to send transactions to the given application """ @@ -61,10 +60,9 @@ class TxDescriptor(betterproto.Message): fullname: str = betterproto.string_field(1) """ - fullname is the protobuf fullname of the raw transaction type (for instance - the tx.Tx type) it is not meant to support polymorphism of transaction - types, it is supposed to be used by reflection clients to understand if - they can handle a specific transaction type in an application. + fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + it is not meant to support polymorphism of transaction types, it is supposed to be used by + reflection clients to understand if they can handle a specific transaction type in an application. """ msgs: List["MsgDescriptor"] = betterproto.message_field(2) @@ -74,8 +72,8 @@ class TxDescriptor(betterproto.Message): @dataclass(eq=False, repr=False) class AuthnDescriptor(betterproto.Message): """ - AuthnDescriptor provides information on how to sign transactions without - relying on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures + AuthnDescriptor provides information on how to sign transactions without relying + on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures """ sign_modes: List["SigningModeDescriptor"] = betterproto.message_field(1) @@ -85,10 +83,10 @@ class AuthnDescriptor(betterproto.Message): @dataclass(eq=False, repr=False) class SigningModeDescriptor(betterproto.Message): """ - SigningModeDescriptor provides information on a signing flow of the - application NOTE(fdymylja): here we could go as far as providing an entire - flow on how to sign a message given a SigningModeDescriptor, but it's - better to think about this another time + SigningModeDescriptor provides information on a signing flow of the application + NOTE(fdymylja): here we could go as far as providing an entire flow on how + to sign a message given a SigningModeDescriptor, but it's better to think about + this another time """ name: str = betterproto.string_field(1) @@ -99,9 +97,8 @@ class SigningModeDescriptor(betterproto.Message): authn_info_provider_method_fullname: str = betterproto.string_field(3) """ - authn_info_provider_method_fullname defines the fullname of the method to - call to get the metadata required to authenticate using the provided - sign_modes + authn_info_provider_method_fullname defines the fullname of the method to call to get + the metadata required to authenticate using the provided sign_modes """ @@ -116,8 +113,7 @@ class ChainDescriptor(betterproto.Message): @dataclass(eq=False, repr=False) class CodecDescriptor(betterproto.Message): """ - CodecDescriptor describes the registered interfaces and provides metadata - information on the types + CodecDescriptor describes the registered interfaces and provides metadata information on the types """ interfaces: List["InterfaceDescriptor"] = betterproto.message_field(1) @@ -131,16 +127,19 @@ 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_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 + interface_implementers is a list of the descriptors of the interface implementers """ @@ -153,18 +152,18 @@ class InterfaceImplementerDescriptor(betterproto.Message): type_url: str = betterproto.string_field(2) """ - type_url defines the type URL used when marshalling the type as any this is - required so we can provide type safe google.protobuf.Any marshalling and - unmarshalling, making sure that we don't accept just 'any' type in our - interface fields + type_url defines the type URL used when marshalling the type as any + this is required so we can provide type safe google.protobuf.Any marshalling and + unmarshalling, making sure that we don't accept just 'any' type + in our interface fields """ @dataclass(eq=False, repr=False) class InterfaceAcceptingMessageDescriptor(betterproto.Message): """ - InterfaceAcceptingMessageDescriptor describes a protobuf message which - contains an interface represented as a google.protobuf.Any + InterfaceAcceptingMessageDescriptor describes a protobuf message which contains + an interface represented as a google.protobuf.Any """ fullname: str = betterproto.string_field(1) @@ -174,9 +173,9 @@ class InterfaceAcceptingMessageDescriptor(betterproto.Message): field_descriptor_names: List[str] = betterproto.string_field(2) """ - field_descriptor_names is a list of the protobuf name (not fullname) of the - field which contains the interface as google.protobuf.Any (the interface is - the same, but it can be in multiple fields of the same proto message) + field_descriptor_names is a list of the protobuf name (not fullname) of the field + which contains the interface as google.protobuf.Any (the interface is the same, but + it can be in multiple fields of the same proto message) """ @@ -193,8 +192,7 @@ class ConfigurationDescriptor(betterproto.Message): @dataclass(eq=False, repr=False) class MsgDescriptor(betterproto.Message): """ - MsgDescriptor describes a cosmos-sdk message that can be delivered with a - transaction + MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction """ msg_type_url: str = betterproto.string_field(1) @@ -204,8 +202,7 @@ class MsgDescriptor(betterproto.Message): @dataclass(eq=False, repr=False) class GetAuthnDescriptorRequest(betterproto.Message): """ - GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor - RPC + GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC """ pass @@ -214,22 +211,19 @@ class GetAuthnDescriptorRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetAuthnDescriptorResponse(betterproto.Message): """ - GetAuthnDescriptorResponse is the response returned by the - GetAuthnDescriptor RPC + GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC """ authn: "AuthnDescriptor" = betterproto.message_field(1) """ - authn describes how to authenticate to the application when sending - transactions + authn describes how to authenticate to the application when sending transactions """ @dataclass(eq=False, repr=False) class GetChainDescriptorRequest(betterproto.Message): """ - GetChainDescriptorRequest is the request used for the GetChainDescriptor - RPC + GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC """ pass @@ -238,8 +232,7 @@ class GetChainDescriptorRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetChainDescriptorResponse(betterproto.Message): """ - GetChainDescriptorResponse is the response returned by the - GetChainDescriptor RPC + GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC """ chain: "ChainDescriptor" = betterproto.message_field(1) @@ -249,8 +242,7 @@ class GetChainDescriptorResponse(betterproto.Message): @dataclass(eq=False, repr=False) class GetCodecDescriptorRequest(betterproto.Message): """ - GetCodecDescriptorRequest is the request used for the GetCodecDescriptor - RPC + GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC """ pass @@ -259,22 +251,19 @@ class GetCodecDescriptorRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetCodecDescriptorResponse(betterproto.Message): """ - GetCodecDescriptorResponse is the response returned by the - GetCodecDescriptor RPC + GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC """ codec: "CodecDescriptor" = betterproto.message_field(1) """ - codec describes the application codec such as registered interfaces and - implementations + codec describes the application codec such as registered interfaces and implementations """ @dataclass(eq=False, repr=False) class GetConfigurationDescriptorRequest(betterproto.Message): """ - GetConfigurationDescriptorRequest is the request used for the - GetConfigurationDescriptor RPC + GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC """ pass @@ -283,8 +272,7 @@ class GetConfigurationDescriptorRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetConfigurationDescriptorResponse(betterproto.Message): """ - GetConfigurationDescriptorResponse is the response returned by the - GetConfigurationDescriptor RPC + GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC """ config: "ConfigurationDescriptor" = betterproto.message_field(1) @@ -294,8 +282,7 @@ class GetConfigurationDescriptorResponse(betterproto.Message): @dataclass(eq=False, repr=False) class GetQueryServicesDescriptorRequest(betterproto.Message): """ - GetQueryServicesDescriptorRequest is the request used for the - GetQueryServicesDescriptor RPC + GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC """ pass @@ -304,8 +291,7 @@ class GetQueryServicesDescriptorRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetQueryServicesDescriptorResponse(betterproto.Message): """ - GetQueryServicesDescriptorResponse is the response returned by the - GetQueryServicesDescriptor RPC + GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC """ queries: "QueryServicesDescriptor" = betterproto.message_field(1) @@ -330,7 +316,7 @@ class GetTxDescriptorResponse(betterproto.Message): tx: "TxDescriptor" = betterproto.message_field(1) """ tx provides information on msgs that can be forwarded to the application - alongside the accepted transaction protobuf type + alongside the accepted transaction protobuf type """ @@ -353,8 +339,7 @@ class QueryServiceDescriptor(betterproto.Message): is_module: bool = betterproto.bool_field(2) """ - is_module describes if this service is actually exposed by an application's - module + is_module describes if this service is actually exposed by an application's module """ methods: List["QueryMethodDescriptor"] = betterproto.message_field(3) @@ -364,9 +349,9 @@ class QueryServiceDescriptor(betterproto.Message): @dataclass(eq=False, repr=False) class QueryMethodDescriptor(betterproto.Message): """ - QueryMethodDescriptor describes a queryable method of a query service no - other info is provided beside method name and tendermint queryable path - because it would be redundant with the grpc reflection service + QueryMethodDescriptor describes a queryable method of a query service + no other info is provided beside method name and tendermint queryable path + because it would be redundant with the grpc reflection service """ name: str = betterproto.string_field(1) @@ -374,8 +359,8 @@ class QueryMethodDescriptor(betterproto.Message): full_query_path: str = betterproto.string_field(2) """ - full_query_path is the path that can be used to query this method via - tendermint abci.Query + full_query_path is the path that can be used to query + this method via tendermint abci.Query """ @@ -484,6 +469,7 @@ async def get_tx_descriptor( class ReflectionServiceBase(ServiceBase): + async def get_authn_descriptor( self, get_authn_descriptor_request: "GetAuthnDescriptorRequest" ) -> "GetAuthnDescriptorResponse": diff --git a/pyband/proto/cosmos/base/tendermint/v1beta1/__init__.py b/pyband/proto/cosmos/base/tendermint/v1beta1/__init__.py index ff60bdd..df905b1 100644 --- a/pyband/proto/cosmos/base/tendermint/v1beta1/__init__.py +++ b/pyband/proto/cosmos/base/tendermint/v1beta1/__init__.py @@ -1,7 +1,10 @@ # 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 +# This file has been @generated + from dataclasses import dataclass +from datetime import datetime from typing import ( TYPE_CHECKING, Dict, @@ -17,6 +20,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,11 +31,58 @@ 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): """ - GetValidatorSetByHeightRequest is the request type for the - Query/GetValidatorSetByHeight RPC method. + GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. """ height: int = betterproto.int64_field(1) @@ -42,8 +93,7 @@ class GetValidatorSetByHeightRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetValidatorSetByHeightResponse(betterproto.Message): """ - GetValidatorSetByHeightResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. + GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. """ block_height: int = betterproto.int64_field(1) @@ -55,8 +105,7 @@ class GetValidatorSetByHeightResponse(betterproto.Message): @dataclass(eq=False, repr=False) class GetLatestValidatorSetRequest(betterproto.Message): """ - GetLatestValidatorSetRequest is the request type for the - Query/GetValidatorSetByHeight RPC method. + GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. """ pagination: "__query_v1_beta1__.PageRequest" = betterproto.message_field(1) @@ -66,8 +115,7 @@ class GetLatestValidatorSetRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetLatestValidatorSetResponse(betterproto.Message): """ - GetLatestValidatorSetResponse is the response type for the - Query/GetValidatorSetByHeight RPC method. + GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. """ block_height: int = betterproto.int64_field(1) @@ -89,8 +137,7 @@ class Validator(betterproto.Message): @dataclass(eq=False, repr=False) class GetBlockByHeightRequest(betterproto.Message): """ - GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight - RPC method. + GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. """ height: int = betterproto.int64_field(1) @@ -99,19 +146,21 @@ class GetBlockByHeightRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetBlockByHeightResponse(betterproto.Message): """ - GetBlockByHeightResponse is the response type for the - Query/GetBlockByHeight RPC method. + GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. """ 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) class GetLatestBlockRequest(betterproto.Message): """ - GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC - method. + GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. """ pass @@ -120,12 +169,15 @@ class GetLatestBlockRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetLatestBlockResponse(betterproto.Message): """ - GetLatestBlockResponse is the response type for the Query/GetLatestBlock - RPC method. + GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. """ 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) @@ -140,8 +192,7 @@ class GetSyncingRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetSyncingResponse(betterproto.Message): """ - GetSyncingResponse is the response type for the Query/GetSyncing RPC - method. + GetSyncingResponse is the response type for the Query/GetSyncing RPC method. """ syncing: bool = betterproto.bool_field(1) @@ -150,8 +201,7 @@ class GetSyncingResponse(betterproto.Message): @dataclass(eq=False, repr=False) class GetNodeInfoRequest(betterproto.Message): """ - GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC - method. + GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. """ pass @@ -160,11 +210,12 @@ class GetNodeInfoRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetNodeInfoResponse(betterproto.Message): """ - GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC - method. + GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. """ - default_node_info: "____tendermint_p2_p__.DefaultNodeInfo" = betterproto.message_field(1) + default_node_info: "____tendermint_p2_p__.DefaultNodeInfo" = ( + betterproto.message_field(1) + ) application_version: "VersionInfo" = betterproto.message_field(2) @@ -197,6 +248,64 @@ 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, @@ -300,15 +409,39 @@ async def get_validator_set_by_height( metadata=metadata, ) + async def abci_query( + self, + abci_query_request: "AbciQueryRequest", + *, + 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": + + async def get_node_info( + self, get_node_info_request: "GetNodeInfoRequest" + ) -> "GetNodeInfoResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def get_syncing(self, get_syncing_request: "GetSyncingRequest") -> "GetSyncingResponse": + async def get_syncing( + self, get_syncing_request: "GetSyncingRequest" + ) -> "GetSyncingResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def get_latest_block(self, get_latest_block_request: "GetLatestBlockRequest") -> "GetLatestBlockResponse": + async def get_latest_block( + self, get_latest_block_request: "GetLatestBlockRequest" + ) -> "GetLatestBlockResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def get_block_by_height( @@ -326,6 +459,11 @@ async def get_validator_set_by_height( ) -> "GetValidatorSetByHeightResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def abci_query( + self, abci_query_request: "AbciQueryRequest" + ) -> "AbciQueryResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + async def __rpc_get_node_info( self, stream: "grpclib.server.Stream[GetNodeInfoRequest, GetNodeInfoResponse]" ) -> None: @@ -333,7 +471,9 @@ async def __rpc_get_node_info( response = await self.get_node_info(request) await stream.send_message(response) - async def __rpc_get_syncing(self, stream: "grpclib.server.Stream[GetSyncingRequest, GetSyncingResponse]") -> None: + async def __rpc_get_syncing( + self, stream: "grpclib.server.Stream[GetSyncingRequest, GetSyncingResponse]" + ) -> None: request = await stream.recv_message() response = await self.get_syncing(request) await stream.send_message(response) @@ -370,6 +510,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( @@ -408,4 +555,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/pyband/proto/cosmos/base/v1beta1/__init__.py b/pyband/proto/cosmos/base/v1beta1/__init__.py index a5bceee..6459c67 100644 --- a/pyband/proto/cosmos/base/v1beta1/__init__.py +++ b/pyband/proto/cosmos/base/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/base/v1beta1/coin.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto @@ -9,9 +11,10 @@ @dataclass(eq=False, repr=False) class Coin(betterproto.Message): """ - Coin defines a token with a denomination and an amount. NOTE: The amount - field is an Int which implements the custom method signatures required by - gogoproto. + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. """ denom: str = betterproto.string_field(1) @@ -21,9 +24,10 @@ class Coin(betterproto.Message): @dataclass(eq=False, repr=False) class DecCoin(betterproto.Message): """ - DecCoin defines a token with a denomination and a decimal amount. NOTE: The - amount field is an Dec which implements the custom method signatures - required by gogoproto. + DecCoin defines a token with a denomination and a decimal amount. + + NOTE: The amount field is an Dec which implements the custom method + signatures required by gogoproto. """ denom: str = betterproto.string_field(1) @@ -32,13 +36,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/pyband/proto/cosmos/capability/v1beta1/__init__.py b/pyband/proto/cosmos/capability/v1beta1/__init__.py deleted file mode 100644 index 0068981..0000000 --- a/pyband/proto/cosmos/capability/v1beta1/__init__.py +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/capability/v1beta1/capability.proto, cosmos/capability/v1beta1/genesis.proto -# plugin: python-betterproto -from dataclasses import dataclass -from typing import List - -import betterproto - - -@dataclass(eq=False, repr=False) -class Capability(betterproto.Message): - """ - Capability defines an implementation of an object capability. The index - provided to a Capability must be globally unique. - """ - - index: int = betterproto.uint64_field(1) - - -@dataclass(eq=False, repr=False) -class Owner(betterproto.Message): - """ - Owner defines a single capability owner. An owner is defined by the name of - capability and the module name. - """ - - module: str = betterproto.string_field(1) - name: str = betterproto.string_field(2) - - -@dataclass(eq=False, repr=False) -class CapabilityOwners(betterproto.Message): - """ - CapabilityOwners defines a set of owners of a single Capability. The set of - owners must be unique. - """ - - owners: List["Owner"] = betterproto.message_field(1) - - -@dataclass(eq=False, repr=False) -class GenesisOwners(betterproto.Message): - """ - GenesisOwners defines the capability owners with their corresponding index. - """ - - index: int = betterproto.uint64_field(1) - """index is the index of the capability owner.""" - - index_owners: "CapabilityOwners" = betterproto.message_field(2) - """index_owners are the owners at the given index.""" - - -@dataclass(eq=False, repr=False) -class GenesisState(betterproto.Message): - """GenesisState defines the capability module's genesis state.""" - - index: int = betterproto.uint64_field(1) - """index is the capability global index.""" - - owners: List["GenesisOwners"] = betterproto.message_field(2) - """ - owners represents a map from index to owners of the capability index index - key is string to allow amino marshalling. - """ diff --git a/pyband/proto/cosmos/circuit/__init__.py b/pyband/proto/cosmos/circuit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/circuit/module/__init__.py b/pyband/proto/cosmos/circuit/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/circuit/module/v1/__init__.py b/pyband/proto/cosmos/circuit/module/v1/__init__.py new file mode 100644 index 0000000..a055224 --- /dev/null +++ b/pyband/proto/cosmos/circuit/module/v1/__init__.py @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/circuit/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the circuit module.""" + + authority: str = betterproto.string_field(1) + """ + authority defines the custom module authority. If not set, defaults to the governance module. + """ diff --git a/pyband/proto/cosmos/circuit/v1/__init__.py b/pyband/proto/cosmos/circuit/v1/__init__.py new file mode 100644 index 0000000..89a19b7 --- /dev/null +++ b/pyband/proto/cosmos/circuit/v1/__init__.py @@ -0,0 +1,469 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/circuit/v1beta1/query.proto, cosmos/circuit/v1beta1/tx.proto, cosmos/circuit/v1beta1/types.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Dict, + List, + Optional, +) + +import betterproto +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 + + +class PermissionsLevel(betterproto.Enum): + """Level is the permission level.""" + + LEVEL_NONE_UNSPECIFIED = 0 + """ + LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit + breaker permissions. + """ + + LEVEL_SOME_MSGS = 1 + """ + LEVEL_SOME_MSGS indicates that the account will have permission to + trip or reset the circuit breaker for some Msg type URLs. If this level + is chosen, a non-empty list of Msg type URLs must be provided in + limit_type_urls. + """ + + LEVEL_ALL_MSGS = 2 + """ + LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit + breaker for Msg's of all type URLs. + """ + + LEVEL_SUPER_ADMIN = 3 + """ + LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker + actions and can grant permissions to other accounts. + """ + + +@dataclass(eq=False, repr=False) +class Permissions(betterproto.Message): + """ + Permissions are the permissions that an account has to trip + or reset the circuit breaker. + """ + + level: "PermissionsLevel" = betterproto.enum_field(1) + """level is the level of permissions granted to this account.""" + + limit_type_urls: List[str] = betterproto.string_field(2) + """ + limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type + URLs that the account can trip. It is an error to use limit_type_urls with + a level other than LEVEL_SOME_MSGS. + """ + + +@dataclass(eq=False, repr=False) +class GenesisAccountPermissions(betterproto.Message): + """ + GenesisAccountPermissions is the account permissions for the circuit breaker in genesis + """ + + address: str = betterproto.string_field(1) + permissions: "Permissions" = betterproto.message_field(2) + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState is the state that must be provided at genesis.""" + + account_permissions: List["GenesisAccountPermissions"] = betterproto.message_field( + 1 + ) + disabled_type_urls: List[str] = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class MsgAuthorizeCircuitBreaker(betterproto.Message): + """ + MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. + """ + + granter: str = betterproto.string_field(1) + """ + granter is the granter of the circuit breaker permissions and must have + LEVEL_SUPER_ADMIN. + """ + + grantee: str = betterproto.string_field(2) + """grantee is the account authorized with the provided permissions.""" + + permissions: "Permissions" = betterproto.message_field(3) + """ + permissions are the circuit breaker permissions that the grantee receives. + These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can + be specified to revoke all permissions. + """ + + +@dataclass(eq=False, repr=False) +class MsgAuthorizeCircuitBreakerResponse(betterproto.Message): + """ + MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. + """ + + success: bool = betterproto.bool_field(1) + + +@dataclass(eq=False, repr=False) +class MsgTripCircuitBreaker(betterproto.Message): + """ + MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. + """ + + authority: str = betterproto.string_field(1) + """authority is the account authorized to trip the circuit breaker.""" + + msg_type_urls: List[str] = betterproto.string_field(2) + """ + msg_type_urls specifies a list of type URLs to immediately stop processing. + IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. + This value is validated against the authority's permissions and if the + authority does not have permissions to trip the specified msg type URLs + (or all URLs), the operation will fail. + """ + + +@dataclass(eq=False, repr=False) +class MsgTripCircuitBreakerResponse(betterproto.Message): + """ + MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. + """ + + success: bool = betterproto.bool_field(1) + + +@dataclass(eq=False, repr=False) +class MsgResetCircuitBreaker(betterproto.Message): + """ + MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. + """ + + authority: str = betterproto.string_field(1) + """ + authority is the account authorized to trip or reset the circuit breaker. + """ + + msg_type_urls: List[str] = betterproto.string_field(3) + """ + msg_type_urls specifies a list of Msg type URLs to resume processing. If + it is left empty all Msg processing for type URLs that the account is + authorized to trip will resume. + """ + + +@dataclass(eq=False, repr=False) +class MsgResetCircuitBreakerResponse(betterproto.Message): + """ + MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. + """ + + success: bool = betterproto.bool_field(1) + + +@dataclass(eq=False, repr=False) +class QueryAccountRequest(betterproto.Message): + """ + QueryAccountRequest is the request type for the Query/Account RPC method. + """ + + address: str = betterproto.string_field(1) + + +@dataclass(eq=False, repr=False) +class AccountResponse(betterproto.Message): + """ + AccountResponse is the response type for the Query/Account RPC method. + """ + + permission: "Permissions" = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class QueryAccountsRequest(betterproto.Message): + """ + QueryAccountsRequest is the request type for the Query/Accounts RPC method. + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class AccountsResponse(betterproto.Message): + """ + AccountsResponse is the response type for the Query/Accounts RPC method. + """ + + accounts: List["GenesisAccountPermissions"] = 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 QueryDisabledListRequest(betterproto.Message): + """ + QueryDisableListRequest is the request type for the Query/DisabledList RPC method. + """ + + pass + + +@dataclass(eq=False, repr=False) +class DisabledListResponse(betterproto.Message): + """ + DisabledListResponse is the response type for the Query/DisabledList RPC method. + """ + + disabled_list: List[str] = betterproto.string_field(1) + + +class MsgStub(betterproto.ServiceStub): + async def authorize_circuit_breaker( + self, + msg_authorize_circuit_breaker: "MsgAuthorizeCircuitBreaker", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgAuthorizeCircuitBreakerResponse": + return await self._unary_unary( + "/cosmos.circuit.v1beta1.Msg/AuthorizeCircuitBreaker", + msg_authorize_circuit_breaker, + MsgAuthorizeCircuitBreakerResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def trip_circuit_breaker( + self, + msg_trip_circuit_breaker: "MsgTripCircuitBreaker", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgTripCircuitBreakerResponse": + return await self._unary_unary( + "/cosmos.circuit.v1beta1.Msg/TripCircuitBreaker", + msg_trip_circuit_breaker, + MsgTripCircuitBreakerResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def reset_circuit_breaker( + self, + msg_reset_circuit_breaker: "MsgResetCircuitBreaker", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgResetCircuitBreakerResponse": + return await self._unary_unary( + "/cosmos.circuit.v1beta1.Msg/ResetCircuitBreaker", + msg_reset_circuit_breaker, + MsgResetCircuitBreakerResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def account( + self, + query_account_request: "QueryAccountRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "AccountResponse": + return await self._unary_unary( + "/cosmos.circuit.v1beta1.Query/Account", + query_account_request, + AccountResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def accounts( + self, + query_accounts_request: "QueryAccountsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "AccountsResponse": + return await self._unary_unary( + "/cosmos.circuit.v1beta1.Query/Accounts", + query_accounts_request, + AccountsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def disabled_list( + self, + query_disabled_list_request: "QueryDisabledListRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "DisabledListResponse": + return await self._unary_unary( + "/cosmos.circuit.v1beta1.Query/DisabledList", + query_disabled_list_request, + DisabledListResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def authorize_circuit_breaker( + self, msg_authorize_circuit_breaker: "MsgAuthorizeCircuitBreaker" + ) -> "MsgAuthorizeCircuitBreakerResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def trip_circuit_breaker( + self, msg_trip_circuit_breaker: "MsgTripCircuitBreaker" + ) -> "MsgTripCircuitBreakerResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def reset_circuit_breaker( + self, msg_reset_circuit_breaker: "MsgResetCircuitBreaker" + ) -> "MsgResetCircuitBreakerResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_authorize_circuit_breaker( + self, + stream: "grpclib.server.Stream[MsgAuthorizeCircuitBreaker, MsgAuthorizeCircuitBreakerResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.authorize_circuit_breaker(request) + await stream.send_message(response) + + async def __rpc_trip_circuit_breaker( + self, + stream: "grpclib.server.Stream[MsgTripCircuitBreaker, MsgTripCircuitBreakerResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.trip_circuit_breaker(request) + await stream.send_message(response) + + async def __rpc_reset_circuit_breaker( + self, + stream: "grpclib.server.Stream[MsgResetCircuitBreaker, MsgResetCircuitBreakerResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.reset_circuit_breaker(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.circuit.v1beta1.Msg/AuthorizeCircuitBreaker": grpclib.const.Handler( + self.__rpc_authorize_circuit_breaker, + grpclib.const.Cardinality.UNARY_UNARY, + MsgAuthorizeCircuitBreaker, + MsgAuthorizeCircuitBreakerResponse, + ), + "/cosmos.circuit.v1beta1.Msg/TripCircuitBreaker": grpclib.const.Handler( + self.__rpc_trip_circuit_breaker, + grpclib.const.Cardinality.UNARY_UNARY, + MsgTripCircuitBreaker, + MsgTripCircuitBreakerResponse, + ), + "/cosmos.circuit.v1beta1.Msg/ResetCircuitBreaker": grpclib.const.Handler( + self.__rpc_reset_circuit_breaker, + grpclib.const.Cardinality.UNARY_UNARY, + MsgResetCircuitBreaker, + MsgResetCircuitBreakerResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def account( + self, query_account_request: "QueryAccountRequest" + ) -> "AccountResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def accounts( + self, query_accounts_request: "QueryAccountsRequest" + ) -> "AccountsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def disabled_list( + self, query_disabled_list_request: "QueryDisabledListRequest" + ) -> "DisabledListResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_account( + self, stream: "grpclib.server.Stream[QueryAccountRequest, AccountResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.account(request) + await stream.send_message(response) + + async def __rpc_accounts( + self, stream: "grpclib.server.Stream[QueryAccountsRequest, AccountsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.accounts(request) + await stream.send_message(response) + + async def __rpc_disabled_list( + self, + stream: "grpclib.server.Stream[QueryDisabledListRequest, DisabledListResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.disabled_list(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.circuit.v1beta1.Query/Account": grpclib.const.Handler( + self.__rpc_account, + grpclib.const.Cardinality.UNARY_UNARY, + QueryAccountRequest, + AccountResponse, + ), + "/cosmos.circuit.v1beta1.Query/Accounts": grpclib.const.Handler( + self.__rpc_accounts, + grpclib.const.Cardinality.UNARY_UNARY, + QueryAccountsRequest, + AccountsResponse, + ), + "/cosmos.circuit.v1beta1.Query/DisabledList": grpclib.const.Handler( + self.__rpc_disabled_list, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDisabledListRequest, + DisabledListResponse, + ), + } diff --git a/pyband/proto/cosmos/consensus/__init__.py b/pyband/proto/cosmos/consensus/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/consensus/module/__init__.py b/pyband/proto/cosmos/consensus/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/consensus/module/v1/__init__.py b/pyband/proto/cosmos/consensus/module/v1/__init__.py new file mode 100644 index 0000000..51c981f --- /dev/null +++ b/pyband/proto/cosmos/consensus/module/v1/__init__.py @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/consensus/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/consensus/v1/__init__.py b/pyband/proto/cosmos/consensus/v1/__init__.py new file mode 100644 index 0000000..278fb6f --- /dev/null +++ b/pyband/proto/cosmos/consensus/v1/__init__.py @@ -0,0 +1,168 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/consensus/v1beta1/query.proto, cosmos/consensus/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +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.v1beta1.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.v1beta1.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.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": + 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.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + } diff --git a/pyband/proto/cosmos/crisis/module/__init__.py b/pyband/proto/cosmos/crisis/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/crisis/module/v1/__init__.py b/pyband/proto/cosmos/crisis/module/v1/__init__.py new file mode 100644 index 0000000..73defa3 --- /dev/null +++ b/pyband/proto/cosmos/crisis/module/v1/__init__.py @@ -0,0 +1,21 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/crisis/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/crisis/v1beta1/__init__.py b/pyband/proto/cosmos/crisis/v1beta1/__init__.py index c157bb1..9f8c1f5 100644 --- a/pyband/proto/cosmos/crisis/v1beta1/__init__.py +++ b/pyband/proto/cosmos/crisis/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/crisis/v1beta1/genesis.proto, cosmos/crisis/v1beta1/tx.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -28,8 +30,15 @@ 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,13 +50,43 @@ 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.""" constant_fee: "__base_v1_beta1__.Coin" = betterproto.message_field(3) """ - constant_fee is the fee used to verify the invariant in the crisis module. + constant_fee is the fee used to verify the invariant in the crisis + module. """ @@ -69,9 +108,34 @@ 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": + + 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( @@ -82,6 +146,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( @@ -90,4 +161,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/pyband/proto/cosmos/crypto/ed25519/__init__.py b/pyband/proto/cosmos/crypto/ed25519/__init__.py index 5f00099..f15196d 100644 --- a/pyband/proto/cosmos/crypto/ed25519/__init__.py +++ b/pyband/proto/cosmos/crypto/ed25519/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/crypto/ed25519/keys.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto @@ -9,11 +11,11 @@ @dataclass(eq=False, repr=False) class PubKey(betterproto.Message): """ - PubKey is an ed25519 public key for handling Tendermint keys in SDK. It's - needed for Any serialization and SDK compatibility. It must not be used in - a non Tendermint key context because it doesn't implement ADR-28. - Nevertheless, you will like to use ed25519 in app user level then you must - create a new proto message and follow ADR-28 for Address construction. + PubKey is an ed25519 public key for handling Tendermint keys in SDK. + It's needed for Any serialization and SDK compatibility. + It must not be used in a non Tendermint key context because it doesn't implement + ADR-28. Nevertheless, you will like to use ed25519 in app user level + then you must create a new proto message and follow ADR-28 for Address construction. """ key: bytes = betterproto.bytes_field(1) @@ -22,8 +24,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/pyband/proto/cosmos/crypto/hd/__init__.py b/pyband/proto/cosmos/crypto/hd/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/crypto/hd/v1/__init__.py b/pyband/proto/cosmos/crypto/hd/v1/__init__.py new file mode 100644 index 0000000..1fa2be3 --- /dev/null +++ b/pyband/proto/cosmos/crypto/hd/v1/__init__.py @@ -0,0 +1,33 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/crypto/hd/v1beta1/hd.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/crypto/keyring/__init__.py b/pyband/proto/cosmos/crypto/keyring/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/crypto/keyring/v1/__init__.py b/pyband/proto/cosmos/crypto/keyring/v1/__init__.py new file mode 100644 index 0000000..5c1f67a --- /dev/null +++ b/pyband/proto/cosmos/crypto/keyring/v1/__init__.py @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/crypto/keyring/v1beta1/record.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/crypto/multisig/__init__.py b/pyband/proto/cosmos/crypto/multisig/__init__.py index 33857fd..189816b 100644 --- a/pyband/proto/cosmos/crypto/multisig/__init__.py +++ b/pyband/proto/cosmos/crypto/multisig/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/crypto/multisig/keys.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List @@ -11,9 +13,12 @@ @dataclass(eq=False, repr=False) class LegacyAminoPubKey(betterproto.Message): """ - LegacyAminoPubKey specifies a public key type which nests multiple public - keys and a threshold, it uses legacy amino address rules. + LegacyAminoPubKey specifies a public key type + which nests multiple public keys and a threshold, + it uses legacy amino address rules. """ 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/pyband/proto/cosmos/crypto/multisig/v1beta1/__init__.py b/pyband/proto/cosmos/crypto/multisig/v1beta1/__init__.py index c6bea82..393df09 100644 --- a/pyband/proto/cosmos/crypto/multisig/v1beta1/__init__.py +++ b/pyband/proto/cosmos/crypto/multisig/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/crypto/multisig/v1beta1/multisig.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List @@ -10,9 +12,9 @@ @dataclass(eq=False, repr=False) class MultiSignature(betterproto.Message): """ - MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. See - cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers signed - and with which modes. + MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. + See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers + signed and with which modes. """ signatures: List[bytes] = betterproto.bytes_field(1) @@ -21,10 +23,10 @@ class MultiSignature(betterproto.Message): @dataclass(eq=False, repr=False) class CompactBitArray(betterproto.Message): """ - CompactBitArray is an implementation of a space efficient bit array. This - is used to ensure that the encoded data takes up a minimal amount of space - after proto encoding. This is not thread safe, and is not intended for - concurrent usage. + CompactBitArray is an implementation of a space efficient bit array. + This is used to ensure that the encoded data takes up a minimal amount of + space after proto encoding. + This is not thread safe, and is not intended for concurrent usage. """ extra_bits_stored: int = betterproto.uint32_field(1) diff --git a/pyband/proto/cosmos/crypto/secp256k1/__init__.py b/pyband/proto/cosmos/crypto/secp256k1/__init__.py index 050d59e..bc56d27 100644 --- a/pyband/proto/cosmos/crypto/secp256k1/__init__.py +++ b/pyband/proto/cosmos/crypto/secp256k1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/crypto/secp256k1/keys.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto @@ -9,11 +11,11 @@ @dataclass(eq=False, repr=False) class PubKey(betterproto.Message): """ - PubKey defines a secp256k1 public key Key is the compressed form of the - pubkey. The first byte depends is a 0x02 byte if the y-coordinate is the - lexicographically largest of the two associated with the x-coordinate. - Otherwise the first byte is a 0x03. This prefix is followed with the - x-coordinate. + PubKey defines a secp256k1 public key + Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte + if the y-coordinate is the lexicographically largest of the two associated with + the x-coordinate. Otherwise the first byte is a 0x03. + This prefix is followed with the x-coordinate. """ key: bytes = betterproto.bytes_field(1) diff --git a/pyband/proto/cosmos/crypto/secp256r1/__init__.py b/pyband/proto/cosmos/crypto/secp256r1/__init__.py index 54b9718..7dbaf94 100644 --- a/pyband/proto/cosmos/crypto/secp256r1/__init__.py +++ b/pyband/proto/cosmos/crypto/secp256r1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/crypto/secp256r1/keys.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto @@ -12,9 +14,8 @@ class PubKey(betterproto.Message): key: bytes = betterproto.bytes_field(1) """ - Point on secp256r1 curve in a compressed representation as specified in - section 4.3.6 of ANSI X9.62: - https://webstore.ansi.org/standards/ascx9/ansix9621998 + Point on secp256r1 curve in a compressed representation as specified in section + 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 """ diff --git a/pyband/proto/cosmos/distribution/module/__init__.py b/pyband/proto/cosmos/distribution/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/distribution/module/v1/__init__.py b/pyband/proto/cosmos/distribution/module/v1/__init__.py new file mode 100644 index 0000000..200a9d8 --- /dev/null +++ b/pyband/proto/cosmos/distribution/module/v1/__init__.py @@ -0,0 +1,19 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/distribution/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/distribution/v1beta1/__init__.py b/pyband/proto/cosmos/distribution/v1beta1/__init__.py index 3729186..b2a6d8a 100644 --- a/pyband/proto/cosmos/distribution/v1beta1/__init__.py +++ b/pyband/proto/cosmos/distribution/v1beta1/__init__.py @@ -1,6 +1,8 @@ # 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 +# This file has been @generated +import warnings from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -24,229 +26,356 @@ @dataclass(eq=False, repr=False) -class MsgSetWithdrawAddress(betterproto.Message): +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) """ - MsgSetWithdrawAddress sets the withdraw address for a delegator (or - validator self-delegation). + Deprecated: The base_proposer_reward field is deprecated and is no longer used + in the x/distribution module's reward mechanism. """ - delegator_address: str = betterproto.string_field(1) - withdraw_address: str = betterproto.string_field(2) + bonus_proposer_reward: str = betterproto.string_field(3) + """ + Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + in the x/distribution module's reward mechanism. + """ + + withdraw_addr_enabled: bool = betterproto.bool_field(4) + + 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) -class MsgSetWithdrawAddressResponse(betterproto.Message): +class ValidatorHistoricalRewards(betterproto.Message): """ - MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response - type. + ValidatorHistoricalRewards represents historical rewards for a validator. + Height is implicit within the store key. + Cumulative reward ratio is the sum from the zeroeth period + until this period of rewards / tokens, per the spec. + The reference count indicates the number of objects + which might need to reference this historical entry at any point. + ReferenceCount = + number of outstanding delegations which ended the associated period (and + might need to read that record) + + number of slashes which ended the associated period (and might need to + read that record) + + one per validator for the zeroeth period, set on initialization + """ + + cumulative_reward_ratio: List["__base_v1_beta1__.DecCoin"] = ( + betterproto.message_field(1) + ) + reference_count: int = betterproto.uint32_field(2) + + +@dataclass(eq=False, repr=False) +class ValidatorCurrentRewards(betterproto.Message): + """ + ValidatorCurrentRewards represents current rewards and current + period for a validator kept as a running counter and incremented + each block as long as the validator's tokens remain constant. """ - pass + rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) + period: int = betterproto.uint64_field(2) @dataclass(eq=False, repr=False) -class MsgWithdrawDelegatorReward(betterproto.Message): +class ValidatorAccumulatedCommission(betterproto.Message): """ - MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator - from a single validator. + ValidatorAccumulatedCommission represents accumulated commission + for a validator kept as a running counter, can be withdrawn at any time. """ - delegator_address: str = betterproto.string_field(1) - validator_address: str = betterproto.string_field(2) + commission: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) @dataclass(eq=False, repr=False) -class MsgWithdrawDelegatorRewardResponse(betterproto.Message): +class ValidatorOutstandingRewards(betterproto.Message): """ - MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward - response type. + ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards + for a validator inexpensive to track, allows simple sanity checks. """ - pass + rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) @dataclass(eq=False, repr=False) -class MsgWithdrawValidatorCommission(betterproto.Message): +class ValidatorSlashEvent(betterproto.Message): """ - MsgWithdrawValidatorCommission withdraws the full commission to the - validator address. + ValidatorSlashEvent represents a validator slash event. + Height is implicit within the store key. + This is needed to calculate appropriate amount of staking tokens + for delegations which are withdrawn after a slash has occurred. + """ + + validator_period: int = betterproto.uint64_field(1) + fraction: str = betterproto.string_field(2) + + +@dataclass(eq=False, repr=False) +class ValidatorSlashEvents(betterproto.Message): + """ + ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. + """ + + validator_slash_events: List["ValidatorSlashEvent"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +class FeePool(betterproto.Message): + """FeePool is the global fee pool for distribution.""" + + community_pool: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) + + +@dataclass(eq=False, repr=False) +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. + + 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 v1beta1 governance proposal. + """ + + title: str = betterproto.string_field(1) + description: str = betterproto.string_field(2) + 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): + """ + DelegatorStartingInfo represents the starting info for a delegator reward + period. It tracks the previous validator period, the delegation's amount of + staking token, and the creation height (to check later on if any slashes have + occurred). NOTE: Even though validators are slashed to whole staking tokens, + the delegators within the validator may be left with less than a full token, + thus sdk.Dec is used. + """ + + previous_period: int = betterproto.uint64_field(1) + stake: str = betterproto.string_field(2) + height: int = betterproto.uint64_field(3) + + +@dataclass(eq=False, repr=False) +class DelegationDelegatorReward(betterproto.Message): + """ + DelegationDelegatorReward represents the properties + of a delegator's delegation reward. """ validator_address: str = betterproto.string_field(1) + reward: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(2) @dataclass(eq=False, repr=False) -class MsgWithdrawValidatorCommissionResponse(betterproto.Message): +class CommunityPoolSpendProposalWithDeposit(betterproto.Message): """ - MsgWithdrawValidatorCommissionResponse defines the - Msg/WithdrawValidatorCommission response type. + CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal + with a deposit """ - pass + title: str = betterproto.string_field(1) + description: str = betterproto.string_field(2) + recipient: str = betterproto.string_field(3) + amount: str = betterproto.string_field(4) + deposit: str = betterproto.string_field(5) @dataclass(eq=False, repr=False) -class MsgFundCommunityPool(betterproto.Message): +class MsgSetWithdrawAddress(betterproto.Message): """ - MsgFundCommunityPool allows an account to directly fund the community pool. + MsgSetWithdrawAddress sets the withdraw address for + a delegator (or validator self-delegation). """ - amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) - depositor: str = betterproto.string_field(2) + delegator_address: str = betterproto.string_field(1) + withdraw_address: str = betterproto.string_field(2) @dataclass(eq=False, repr=False) -class MsgFundCommunityPoolResponse(betterproto.Message): +class MsgSetWithdrawAddressResponse(betterproto.Message): """ - MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response - type. + MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + type. """ pass @dataclass(eq=False, repr=False) -class Params(betterproto.Message): - """Params defines the set of params for the distribution module.""" +class MsgWithdrawDelegatorReward(betterproto.Message): + """ + MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator + from a single validator. + """ - 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) + delegator_address: str = betterproto.string_field(1) + validator_address: str = betterproto.string_field(2) @dataclass(eq=False, repr=False) -class ValidatorHistoricalRewards(betterproto.Message): +class MsgWithdrawDelegatorRewardResponse(betterproto.Message): """ - ValidatorHistoricalRewards represents historical rewards for a validator. - Height is implicit within the store key. Cumulative reward ratio is the sum - from the zeroeth period until this period of rewards / tokens, per the - spec. The reference count indicates the number of objects which might need - to reference this historical entry at any point. ReferenceCount = number - of outstanding delegations which ended the associated period (and might - need to read that record) + number of slashes which ended the associated - period (and might need to read that record) + one per validator for the - zeroeth period, set on initialization + MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + response type. """ - cumulative_reward_ratio: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) - reference_count: int = betterproto.uint32_field(2) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """Since: cosmos-sdk 0.46""" @dataclass(eq=False, repr=False) -class ValidatorCurrentRewards(betterproto.Message): +class MsgWithdrawValidatorCommission(betterproto.Message): """ - ValidatorCurrentRewards represents current rewards and current period for a - validator kept as a running counter and incremented each block as long as - the validator's tokens remain constant. + MsgWithdrawValidatorCommission withdraws the full commission to the validator + address. """ - rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) - period: int = betterproto.uint64_field(2) + validator_address: str = betterproto.string_field(1) @dataclass(eq=False, repr=False) -class ValidatorAccumulatedCommission(betterproto.Message): +class MsgWithdrawValidatorCommissionResponse(betterproto.Message): """ - ValidatorAccumulatedCommission represents accumulated commission for a - validator kept as a running counter, can be withdrawn at any time. + MsgWithdrawValidatorCommissionResponse defines the + Msg/WithdrawValidatorCommission response type. """ - commission: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + """Since: cosmos-sdk 0.46""" @dataclass(eq=False, repr=False) -class ValidatorOutstandingRewards(betterproto.Message): +class MsgFundCommunityPool(betterproto.Message): """ - ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards - for a validator inexpensive to track, allows simple sanity checks. + MsgFundCommunityPool allows an account to directly + fund the community pool. """ - rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) + amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) + depositor: str = betterproto.string_field(2) @dataclass(eq=False, repr=False) -class ValidatorSlashEvent(betterproto.Message): +class MsgFundCommunityPoolResponse(betterproto.Message): """ - ValidatorSlashEvent represents a validator slash event. Height is implicit - within the store key. This is needed to calculate appropriate amount of - staking tokens for delegations which are withdrawn after a slash has - occurred. + MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. """ - validator_period: int = betterproto.uint64_field(1) - fraction: str = betterproto.string_field(2) + pass @dataclass(eq=False, repr=False) -class ValidatorSlashEvents(betterproto.Message): +class MsgUpdateParams(betterproto.Message): """ - ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. + MsgUpdateParams is the Msg/UpdateParams request type. + + Since: cosmos-sdk 0.47 """ - validator_slash_events: List["ValidatorSlashEvent"] = betterproto.message_field(1) + 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 FeePool(betterproto.Message): - """FeePool is the global fee pool for distribution.""" +class MsgUpdateParamsResponse(betterproto.Message): + """ + MsgUpdateParamsResponse defines the response structure for executing a + MsgUpdateParams message. - community_pool: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) + Since: cosmos-sdk 0.47 + """ + + pass @dataclass(eq=False, repr=False) -class CommunityPoolSpendProposal(betterproto.Message): +class MsgCommunityPoolSpend(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. + 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 """ - title: str = betterproto.string_field(1) - description: str = betterproto.string_field(2) - recipient: str = betterproto.string_field(3) - amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(4) + 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 DelegatorStartingInfo(betterproto.Message): +class MsgCommunityPoolSpendResponse(betterproto.Message): """ - DelegatorStartingInfo represents the starting info for a delegator reward - period. It tracks the previous validator period, the delegation's amount of - staking token, and the creation height (to check later on if any slashes - have occurred). NOTE: Even though validators are slashed to whole staking - tokens, the delegators within the validator may be left with less than a - full token, thus sdk.Dec is used. + MsgCommunityPoolSpendResponse defines the response to executing a + MsgCommunityPoolSpend message. + + Since: cosmos-sdk 0.47 """ - previous_period: int = betterproto.uint64_field(1) - stake: str = betterproto.string_field(2) - height: int = betterproto.uint64_field(3) + pass @dataclass(eq=False, repr=False) -class DelegationDelegatorReward(betterproto.Message): +class MsgDepositValidatorRewardsPool(betterproto.Message): """ - DelegationDelegatorReward represents the properties of a delegator's - delegation reward. + DepositValidatorRewardsPool defines the request structure to provide + additional rewards to delegators from a specific validator. + + Since: cosmos-sdk 0.50 """ - validator_address: str = betterproto.string_field(1) - reward: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(2) + 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 CommunityPoolSpendProposalWithDeposit(betterproto.Message): +class MsgDepositValidatorRewardsPoolResponse(betterproto.Message): """ - CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal - with a deposit + MsgDepositValidatorRewardsPoolResponse defines the response to executing a + MsgDepositValidatorRewardsPool message. + + Since: cosmos-sdk 0.50 """ - title: str = betterproto.string_field(1) - description: str = betterproto.string_field(2) - recipient: str = betterproto.string_field(3) - amount: str = betterproto.string_field(4) - deposit: str = betterproto.string_field(5) + pass @dataclass(eq=False, repr=False) @@ -268,11 +397,37 @@ 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): """ QueryValidatorOutstandingRewardsRequest is the request type for the - Query/ValidatorOutstandingRewards RPC method. + Query/ValidatorOutstandingRewards RPC method. """ validator_address: str = betterproto.string_field(1) @@ -283,7 +438,7 @@ class QueryValidatorOutstandingRewardsRequest(betterproto.Message): class QueryValidatorOutstandingRewardsResponse(betterproto.Message): """ QueryValidatorOutstandingRewardsResponse is the response type for the - Query/ValidatorOutstandingRewards RPC method. + Query/ValidatorOutstandingRewards RPC method. """ rewards: "ValidatorOutstandingRewards" = betterproto.message_field(1) @@ -293,7 +448,7 @@ class QueryValidatorOutstandingRewardsResponse(betterproto.Message): class QueryValidatorCommissionRequest(betterproto.Message): """ QueryValidatorCommissionRequest is the request type for the - Query/ValidatorCommission RPC method + Query/ValidatorCommission RPC method """ validator_address: str = betterproto.string_field(1) @@ -304,18 +459,18 @@ class QueryValidatorCommissionRequest(betterproto.Message): class QueryValidatorCommissionResponse(betterproto.Message): """ QueryValidatorCommissionResponse is the response type for the - Query/ValidatorCommission RPC method + Query/ValidatorCommission RPC method """ 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) class QueryValidatorSlashesRequest(betterproto.Message): """ QueryValidatorSlashesRequest is the request type for the - Query/ValidatorSlashes RPC method + Query/ValidatorSlashes RPC method """ validator_address: str = betterproto.string_field(1) @@ -339,7 +494,7 @@ class QueryValidatorSlashesRequest(betterproto.Message): class QueryValidatorSlashesResponse(betterproto.Message): """ QueryValidatorSlashesResponse is the response type for the - Query/ValidatorSlashes RPC method. + Query/ValidatorSlashes RPC method. """ slashes: List["ValidatorSlashEvent"] = betterproto.message_field(1) @@ -353,7 +508,7 @@ class QueryValidatorSlashesResponse(betterproto.Message): class QueryDelegationRewardsRequest(betterproto.Message): """ QueryDelegationRewardsRequest is the request type for the - Query/DelegationRewards RPC method. + Query/DelegationRewards RPC method. """ delegator_address: str = betterproto.string_field(1) @@ -367,7 +522,7 @@ class QueryDelegationRewardsRequest(betterproto.Message): class QueryDelegationRewardsResponse(betterproto.Message): """ QueryDelegationRewardsResponse is the response type for the - Query/DelegationRewards RPC method. + Query/DelegationRewards RPC method. """ rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) @@ -378,7 +533,7 @@ class QueryDelegationRewardsResponse(betterproto.Message): class QueryDelegationTotalRewardsRequest(betterproto.Message): """ QueryDelegationTotalRewardsRequest is the request type for the - Query/DelegationTotalRewards RPC method. + Query/DelegationTotalRewards RPC method. """ delegator_address: str = betterproto.string_field(1) @@ -389,7 +544,7 @@ class QueryDelegationTotalRewardsRequest(betterproto.Message): class QueryDelegationTotalRewardsResponse(betterproto.Message): """ QueryDelegationTotalRewardsResponse is the response type for the - Query/DelegationTotalRewards RPC method. + Query/DelegationTotalRewards RPC method. """ rewards: List["DelegationDelegatorReward"] = betterproto.message_field(1) @@ -403,7 +558,7 @@ class QueryDelegationTotalRewardsResponse(betterproto.Message): class QueryDelegatorValidatorsRequest(betterproto.Message): """ QueryDelegatorValidatorsRequest is the request type for the - Query/DelegatorValidators RPC method. + Query/DelegatorValidators RPC method. """ delegator_address: str = betterproto.string_field(1) @@ -414,7 +569,7 @@ class QueryDelegatorValidatorsRequest(betterproto.Message): class QueryDelegatorValidatorsResponse(betterproto.Message): """ QueryDelegatorValidatorsResponse is the response type for the - Query/DelegatorValidators RPC method. + Query/DelegatorValidators RPC method. """ validators: List[str] = betterproto.string_field(1) @@ -425,7 +580,7 @@ class QueryDelegatorValidatorsResponse(betterproto.Message): class QueryDelegatorWithdrawAddressRequest(betterproto.Message): """ QueryDelegatorWithdrawAddressRequest is the request type for the - Query/DelegatorWithdrawAddress RPC method. + Query/DelegatorWithdrawAddress RPC method. """ delegator_address: str = betterproto.string_field(1) @@ -436,7 +591,7 @@ class QueryDelegatorWithdrawAddressRequest(betterproto.Message): class QueryDelegatorWithdrawAddressResponse(betterproto.Message): """ QueryDelegatorWithdrawAddressResponse is the response type for the - Query/DelegatorWithdrawAddress RPC method. + Query/DelegatorWithdrawAddress RPC method. """ withdraw_address: str = betterproto.string_field(1) @@ -446,8 +601,8 @@ class QueryDelegatorWithdrawAddressResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryCommunityPoolRequest(betterproto.Message): """ - QueryCommunityPoolRequest is the request type for the Query/CommunityPool - RPC method. + QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC + method. """ pass @@ -457,7 +612,7 @@ class QueryCommunityPoolRequest(betterproto.Message): class QueryCommunityPoolResponse(betterproto.Message): """ QueryCommunityPoolResponse is the response type for the Query/CommunityPool - RPC method. + RPC method. """ pool: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(1) @@ -468,8 +623,8 @@ class QueryCommunityPoolResponse(betterproto.Message): class DelegatorWithdrawInfo(betterproto.Message): """ DelegatorWithdrawInfo is the address for where distributions rewards are - withdrawn to by default this struct is only used at genesis to feed in - default withdraw addresses. + withdrawn to by default this struct is only used at genesis to feed in + default withdraw addresses. """ delegator_address: str = betterproto.string_field(1) @@ -484,24 +639,25 @@ class DelegatorWithdrawInfo(betterproto.Message): @dataclass(eq=False, repr=False) class ValidatorOutstandingRewardsRecord(betterproto.Message): """ - ValidatorOutstandingRewardsRecord is used for import/export via genesis - json. + ValidatorOutstandingRewardsRecord is used for import/export via genesis json. """ validator_address: str = betterproto.string_field(1) """validator_address is the address of the validator.""" - outstanding_rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field(2) + outstanding_rewards: List["__base_v1_beta1__.DecCoin"] = betterproto.message_field( + 2 + ) """ - outstanding_rewards represents the oustanding rewards of a validator. + outstanding_rewards represents the outstanding rewards of a validator. """ @dataclass(eq=False, repr=False) class ValidatorAccumulatedCommissionRecord(betterproto.Message): """ - ValidatorAccumulatedCommissionRecord is used for import / export via - genesis json. + ValidatorAccumulatedCommissionRecord is used for import / export via genesis + json. """ validator_address: str = betterproto.string_field(1) @@ -515,7 +671,7 @@ class ValidatorAccumulatedCommissionRecord(betterproto.Message): class ValidatorHistoricalRewardsRecord(betterproto.Message): """ ValidatorHistoricalRewardsRecord is used for import / export via genesis - json. + json. """ validator_address: str = betterproto.string_field(1) @@ -567,7 +723,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.""" @@ -581,39 +737,53 @@ 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.""" - delegator_withdraw_infos: List["DelegatorWithdrawInfo"] = betterproto.message_field(3) + delegator_withdraw_infos: List["DelegatorWithdrawInfo"] = betterproto.message_field( + 3 + ) """fee_pool defines the delegator withdraw infos at genesis.""" 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.""" @@ -686,6 +856,57 @@ async def fund_community_pool( 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( @@ -705,6 +926,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", @@ -843,6 +1081,7 @@ async def community_pool( class MsgBase(ServiceBase): + async def set_withdraw_address( self, msg_set_withdraw_address: "MsgSetWithdrawAddress" ) -> "MsgSetWithdrawAddressResponse": @@ -863,6 +1102,21 @@ async def fund_community_pool( ) -> "MsgFundCommunityPoolResponse": 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]", @@ -895,6 +1149,29 @@ async def __rpc_fund_community_pool( response = await self.fund_community_pool(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( @@ -921,11 +1198,38 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: MsgFundCommunityPool, MsgFundCommunityPoolResponse, ), + "/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": + + 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( @@ -971,11 +1275,21 @@ async def community_pool( ) -> "QueryCommunityPoolResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_params(self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]") -> None: + 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_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]", @@ -1048,6 +1362,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, diff --git a/pyband/proto/cosmos/evidence/module/__init__.py b/pyband/proto/cosmos/evidence/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/evidence/module/v1/__init__.py b/pyband/proto/cosmos/evidence/module/v1/__init__.py new file mode 100644 index 0000000..f2a4fb4 --- /dev/null +++ b/pyband/proto/cosmos/evidence/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/evidence/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/evidence/v1beta1/__init__.py b/pyband/proto/cosmos/evidence/v1beta1/__init__.py index 08171b5..fedc34c 100644 --- a/pyband/proto/cosmos/evidence/v1beta1/__init__.py +++ b/pyband/proto/cosmos/evidence/v1beta1/__init__.py @@ -1,6 +1,8 @@ # 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 +# This file has been @generated +import warnings from dataclasses import dataclass from datetime import datetime from typing import ( @@ -28,11 +30,14 @@ class MsgSubmitEvidence(betterproto.Message): """ MsgSubmitEvidence represents a message that supports submitting arbitrary - Evidence of misbehavior such as equivocation or counterfactual signing. + Evidence of misbehavior such as equivocation or counterfactual signing. """ 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) @@ -48,14 +53,21 @@ class MsgSubmitEvidenceResponse(betterproto.Message): @dataclass(eq=False, repr=False) class Equivocation(betterproto.Message): """ - Equivocation implements the Evidence interface and defines evidence of - double signing misbehavior. + Equivocation implements the Evidence interface and defines evidence of double + signing misbehavior. """ 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,14 +77,30 @@ 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) class QueryEvidenceResponse(betterproto.Message): """ - QueryEvidenceResponse is the response type for the Query/Evidence RPC - method. + QueryEvidenceResponse is the response type for the Query/Evidence RPC method. """ evidence: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) @@ -83,7 +111,7 @@ class QueryEvidenceResponse(betterproto.Message): class QueryAllEvidenceRequest(betterproto.Message): """ QueryEvidenceRequest is the request type for the Query/AllEvidence RPC - method. + method. """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) @@ -94,7 +122,7 @@ class QueryAllEvidenceRequest(betterproto.Message): class QueryAllEvidenceResponse(betterproto.Message): """ QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC - method. + method. """ evidence: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) @@ -168,7 +196,10 @@ async def all_evidence( class MsgBase(ServiceBase): - async def submit_evidence(self, msg_submit_evidence: "MsgSubmitEvidence") -> "MsgSubmitEvidenceResponse": + + async def submit_evidence( + self, msg_submit_evidence: "MsgSubmitEvidence" + ) -> "MsgSubmitEvidenceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def __rpc_submit_evidence( @@ -191,10 +222,15 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: class QueryBase(ServiceBase): - async def evidence(self, query_evidence_request: "QueryEvidenceRequest") -> "QueryEvidenceResponse": + + async def evidence( + self, query_evidence_request: "QueryEvidenceRequest" + ) -> "QueryEvidenceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def all_evidence(self, query_all_evidence_request: "QueryAllEvidenceRequest") -> "QueryAllEvidenceResponse": + async def all_evidence( + self, query_all_evidence_request: "QueryAllEvidenceRequest" + ) -> "QueryAllEvidenceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def __rpc_evidence( diff --git a/pyband/proto/cosmos/feegrant/module/__init__.py b/pyband/proto/cosmos/feegrant/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/feegrant/module/v1/__init__.py b/pyband/proto/cosmos/feegrant/module/v1/__init__.py new file mode 100644 index 0000000..fb8ef87 --- /dev/null +++ b/pyband/proto/cosmos/feegrant/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/feegrant/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/feegrant/v1beta1/__init__.py b/pyband/proto/cosmos/feegrant/v1beta1/__init__.py index 13d4897..58d07cc 100644 --- a/pyband/proto/cosmos/feegrant/v1beta1/__init__.py +++ b/pyband/proto/cosmos/feegrant/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/feegrant/v1beta1/feegrant.proto, cosmos/feegrant/v1beta1/genesis.proto, cosmos/feegrant/v1beta1/query.proto, cosmos/feegrant/v1beta1/tx.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from datetime import ( datetime, @@ -31,8 +33,8 @@ @dataclass(eq=False, repr=False) class MsgGrantAllowance(betterproto.Message): """ - MsgGrantAllowance adds permission for Grantee to spend up to Allowance of - fees from the account of Granter. + MsgGrantAllowance adds permission for Grantee to spend up to Allowance + of fees from the account of Granter. """ granter: str = betterproto.string_field(1) @@ -42,19 +44,17 @@ class MsgGrantAllowance(betterproto.Message): grantee: str = betterproto.string_field(2) """ - grantee is the address of the user being granted an allowance of another - user's funds. + grantee is the address of the user being granted an allowance of another user's funds. """ 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) class MsgGrantAllowanceResponse(betterproto.Message): """ - MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response - type. + MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. """ pass @@ -73,16 +73,37 @@ class MsgRevokeAllowance(betterproto.Message): grantee: str = betterproto.string_field(2) """ - grantee is the address of the user being granted an allowance of another - user's funds. + grantee is the address of the user being granted an allowance of another user's funds. """ @dataclass(eq=False, repr=False) class MsgRevokeAllowanceResponse(betterproto.Message): """ - MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response - type. + MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. + """ + + 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 @@ -91,15 +112,15 @@ class MsgRevokeAllowanceResponse(betterproto.Message): @dataclass(eq=False, repr=False) class BasicAllowance(betterproto.Message): """ - BasicAllowance implements Allowance with a one-time grant of tokens that - optionally expires. The grantee can use up to SpendLimit to cover fees. + 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) @@ -109,8 +130,8 @@ class BasicAllowance(betterproto.Message): @dataclass(eq=False, repr=False) class PeriodicAllowance(betterproto.Message): """ - PeriodicAllowance extends Allowance to allow for both a maximum cap, as - well as a limit per time period. + PeriodicAllowance extends Allowance to allow for both a maximum cap, + as well as a limit per time period. """ basic: "BasicAllowance" = betterproto.message_field(1) @@ -118,27 +139,26 @@ class PeriodicAllowance(betterproto.Message): period: timedelta = betterproto.message_field(2) """ - period specifies the time duration in which period_spend_limit coins can be - spent before that allowance is reset + period specifies the time duration in which period_spend_limit coins can + be spent before that allowance is reset """ period_spend_limit: List["__base_v1_beta1__.Coin"] = betterproto.message_field(3) """ period_spend_limit specifies the maximum number of coins that can be spent - in the period + in the period """ period_can_spend: List["__base_v1_beta1__.Coin"] = betterproto.message_field(4) """ - period_can_spend is the number of coins left to be spent before the - period_reset time + period_can_spend is the number of coins left to be spent before the period_reset time """ period_reset: datetime = betterproto.message_field(5) """ period_reset is the time at which this period resets and a new one begins, - it is calculated from the start time of the first transaction after the - last period ended + it is calculated from the start time of the first transaction after the + last period ended """ @@ -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) """ @@ -168,19 +188,17 @@ class Grant(betterproto.Message): grantee: str = betterproto.string_field(2) """ - grantee is the address of the user being granted an allowance of another - user's funds. + grantee is the address of the user being granted an allowance of another user's funds. """ 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) class QueryAllowanceRequest(betterproto.Message): """ - QueryAllowanceRequest is the request type for the Query/Allowance RPC - method. + QueryAllowanceRequest is the request type for the Query/Allowance RPC method. """ granter: str = betterproto.string_field(1) @@ -190,16 +208,14 @@ class QueryAllowanceRequest(betterproto.Message): grantee: str = betterproto.string_field(2) """ - grantee is the address of the user being granted an allowance of another - user's funds. + grantee is the address of the user being granted an allowance of another user's funds. """ @dataclass(eq=False, repr=False) class QueryAllowanceResponse(betterproto.Message): """ - QueryAllowanceResponse is the response type for the Query/Allowance RPC - method. + QueryAllowanceResponse is the response type for the Query/Allowance RPC method. """ allowance: "Grant" = betterproto.message_field(1) @@ -209,8 +225,7 @@ class QueryAllowanceResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryAllowancesRequest(betterproto.Message): """ - QueryAllowancesRequest is the request type for the Query/Allowances RPC - method. + QueryAllowancesRequest is the request type for the Query/Allowances RPC method. """ grantee: str = betterproto.string_field(1) @@ -221,8 +236,7 @@ class QueryAllowancesRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryAllowancesResponse(betterproto.Message): """ - QueryAllowancesResponse is the response type for the Query/Allowances RPC - method. + QueryAllowancesResponse is the response type for the Query/Allowances RPC method. """ allowances: List["Grant"] = betterproto.message_field(1) @@ -235,8 +249,9 @@ class QueryAllowancesResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryAllowancesByGranterRequest(betterproto.Message): """ - QueryAllowancesByGranterRequest is the request type for the - Query/AllowancesByGranter RPC method. + QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + + Since: cosmos-sdk 0.46 """ granter: str = betterproto.string_field(1) @@ -247,8 +262,9 @@ class QueryAllowancesByGranterRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryAllowancesByGranterResponse(betterproto.Message): """ - QueryAllowancesByGranterResponse is the response type for the - Query/AllowancesByGranter RPC method. + QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + + Since: cosmos-sdk 0.46 """ allowances: List["Grant"] = betterproto.message_field(1) @@ -302,6 +318,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,10 +390,20 @@ async def allowances_by_granter( class MsgBase(ServiceBase): - async def grant_allowance(self, msg_grant_allowance: "MsgGrantAllowance") -> "MsgGrantAllowanceResponse": + + async def grant_allowance( + self, msg_grant_allowance: "MsgGrantAllowance" + ) -> "MsgGrantAllowanceResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def revoke_allowance( + self, msg_revoke_allowance: "MsgRevokeAllowance" + ) -> "MsgRevokeAllowanceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def revoke_allowance(self, msg_revoke_allowance: "MsgRevokeAllowance") -> "MsgRevokeAllowanceResponse": + async def prune_allowances( + self, msg_prune_allowances: "MsgPruneAllowances" + ) -> "MsgPruneAllowancesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def __rpc_grant_allowance( @@ -379,6 +422,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( @@ -393,14 +444,25 @@ 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": + + async def allowance( + self, query_allowance_request: "QueryAllowanceRequest" + ) -> "QueryAllowanceResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def allowances(self, query_allowances_request: "QueryAllowancesRequest") -> "QueryAllowancesResponse": + async def allowances( + self, query_allowances_request: "QueryAllowancesRequest" + ) -> "QueryAllowancesResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def allowances_by_granter( diff --git a/pyband/proto/cosmos/genutil/module/__init__.py b/pyband/proto/cosmos/genutil/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/genutil/module/v1/__init__.py b/pyband/proto/cosmos/genutil/module/v1/__init__.py new file mode 100644 index 0000000..dbc5e77 --- /dev/null +++ b/pyband/proto/cosmos/genutil/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/genutil/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/genutil/v1beta1/__init__.py b/pyband/proto/cosmos/genutil/v1beta1/__init__.py index 133c5ae..c5c61e7 100644 --- a/pyband/proto/cosmos/genutil/v1beta1/__init__.py +++ b/pyband/proto/cosmos/genutil/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/genutil/v1beta1/genesis.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List diff --git a/pyband/proto/cosmos/gov/module/__init__.py b/pyband/proto/cosmos/gov/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/gov/module/v1/__init__.py b/pyband/proto/cosmos/gov/module/v1/__init__.py new file mode 100644 index 0000000..dee4cc0 --- /dev/null +++ b/pyband/proto/cosmos/gov/module/v1/__init__.py @@ -0,0 +1,24 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/gov/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/gov/v1/__init__.py b/pyband/proto/cosmos/gov/v1/__init__.py new file mode 100644 index 0000000..97ab6cb --- /dev/null +++ b/pyband/proto/cosmos/gov/v1/__init__.py @@ -0,0 +1,1505 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/gov/v1beta1/genesis.proto, cosmos/gov/v1beta1/gov.proto, cosmos/gov/v1beta1/query.proto, cosmos/gov/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated +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. + """ + + UNSPECIFIED = 0 + """VOTE_OPTION_UNSPECIFIED defines a no-op vote option.""" + + YES = 1 + """VOTE_OPTION_YES defines a yes vote option.""" + + ABSTAIN = 2 + """VOTE_OPTION_ABSTAIN defines an abstain vote option.""" + + NO = 3 + """VOTE_OPTION_NO defines a no 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.""" + + UNSPECIFIED = 0 + """PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.""" + + DEPOSIT_PERIOD = 1 + """ + PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + period. + """ + + VOTING_PERIOD = 2 + """ + PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + period. + """ + + PASSED = 3 + """ + PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + passed. + """ + + REJECTED = 4 + """ + PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + been rejected. + """ + + 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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.Msg/SubmitProposal": grpclib.const.Handler( + self.__rpc_submit_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitProposal, + MsgSubmitProposalResponse, + ), + "/cosmos.gov.v1beta1.Msg/ExecLegacyContent": grpclib.const.Handler( + self.__rpc_exec_legacy_content, + grpclib.const.Cardinality.UNARY_UNARY, + MsgExecLegacyContent, + MsgExecLegacyContentResponse, + ), + "/cosmos.gov.v1beta1.Msg/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + MsgVote, + MsgVoteResponse, + ), + "/cosmos.gov.v1beta1.Msg/VoteWeighted": grpclib.const.Handler( + self.__rpc_vote_weighted, + grpclib.const.Cardinality.UNARY_UNARY, + MsgVoteWeighted, + MsgVoteWeightedResponse, + ), + "/cosmos.gov.v1beta1.Msg/Deposit": grpclib.const.Handler( + self.__rpc_deposit, + grpclib.const.Cardinality.UNARY_UNARY, + MsgDeposit, + MsgDepositResponse, + ), + "/cosmos.gov.v1beta1.Msg/UpdateParams": grpclib.const.Handler( + self.__rpc_update_params, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateParams, + MsgUpdateParamsResponse, + ), + "/cosmos.gov.v1beta1.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.v1beta1.Query/Constitution": grpclib.const.Handler( + self.__rpc_constitution, + grpclib.const.Cardinality.UNARY_UNARY, + QueryConstitutionRequest, + QueryConstitutionResponse, + ), + "/cosmos.gov.v1beta1.Query/Proposal": grpclib.const.Handler( + self.__rpc_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + QueryProposalRequest, + QueryProposalResponse, + ), + "/cosmos.gov.v1beta1.Query/Proposals": grpclib.const.Handler( + self.__rpc_proposals, + grpclib.const.Cardinality.UNARY_UNARY, + QueryProposalsRequest, + QueryProposalsResponse, + ), + "/cosmos.gov.v1beta1.Query/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVoteRequest, + QueryVoteResponse, + ), + "/cosmos.gov.v1beta1.Query/Votes": grpclib.const.Handler( + self.__rpc_votes, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVotesRequest, + QueryVotesResponse, + ), + "/cosmos.gov.v1beta1.Query/Params": grpclib.const.Handler( + self.__rpc_params, + grpclib.const.Cardinality.UNARY_UNARY, + QueryParamsRequest, + QueryParamsResponse, + ), + "/cosmos.gov.v1beta1.Query/Deposit": grpclib.const.Handler( + self.__rpc_deposit, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDepositRequest, + QueryDepositResponse, + ), + "/cosmos.gov.v1beta1.Query/Deposits": grpclib.const.Handler( + self.__rpc_deposits, + grpclib.const.Cardinality.UNARY_UNARY, + QueryDepositsRequest, + QueryDepositsResponse, + ), + "/cosmos.gov.v1beta1.Query/TallyResult": grpclib.const.Handler( + self.__rpc_tally_result, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTallyResultRequest, + QueryTallyResultResponse, + ), + } diff --git a/pyband/proto/cosmos/gov/v1beta1/__init__.py b/pyband/proto/cosmos/gov/v1beta1/__init__.py index a984480..f8e43f8 100644 --- a/pyband/proto/cosmos/gov/v1beta1/__init__.py +++ b/pyband/proto/cosmos/gov/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/gov/v1beta1/genesis.proto, cosmos/gov/v1beta1/gov.proto, cosmos/gov/v1beta1/query.proto, cosmos/gov/v1beta1/tx.proto # plugin: python-betterproto +# This file has been @generated import warnings from dataclasses import dataclass from datetime import ( @@ -31,95 +32,108 @@ class VoteOption(betterproto.Enum): """ - VoteOption enumerates the valid vote options for a given governance - proposal. + VoteOption enumerates the valid vote options for a given governance proposal. """ - VOTE_OPTION_UNSPECIFIED = 0 + UNSPECIFIED = 0 """VOTE_OPTION_UNSPECIFIED defines a no-op vote option.""" - VOTE_OPTION_YES = 1 + YES = 1 """VOTE_OPTION_YES defines a yes vote option.""" - VOTE_OPTION_ABSTAIN = 2 + ABSTAIN = 2 """VOTE_OPTION_ABSTAIN defines an abstain vote option.""" - VOTE_OPTION_NO = 3 + NO = 3 """VOTE_OPTION_NO defines a no vote option.""" - VOTE_OPTION_NO_WITH_VETO = 4 + 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 propopsal status.""" + UNSPECIFIED = 0 + """PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status.""" - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 + DEPOSIT_PERIOD = 1 """ PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - period. + period. """ - PROPOSAL_STATUS_VOTING_PERIOD = 2 + VOTING_PERIOD = 2 """ PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - period. + period. """ - PROPOSAL_STATUS_PASSED = 3 + PASSED = 3 """ PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - passed. + passed. """ - PROPOSAL_STATUS_REJECTED = 4 + REJECTED = 4 """ PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - been rejected. + been rejected. """ - PROPOSAL_STATUS_FAILED = 5 + FAILED = 5 """ PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - failed. + failed. """ @dataclass(eq=False, repr=False) class WeightedVoteOption(betterproto.Message): """ - WeightedVoteOption defines a unit of vote for vote split. Since: cosmos-sdk - 0.43 + WeightedVoteOption defines a unit of vote for vote split. + + Since: cosmos-sdk 0.43 """ 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 TextProposal(betterproto.Message): """ TextProposal defines a standard text proposal whose changes need to be - manually updated in case of approval. + manually updated in case of approval. """ 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) class Deposit(betterproto.Message): """ Deposit defines an amount deposited by an account address to an active - proposal. + 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) @@ -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,29 +177,44 @@ 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) 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. + 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.""" + option: "VoteOption" = betterproto.enum_field(3) """ Deprecated: Prefer to use `options` instead. This field is set in queries - if and only if `len(options) == 1` and that option has weight 1. In all - other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + if and only if `len(options) == 1` and that option has weight 1. In all + other cases, this field will default to VOTE_OPTION_UNSPECIFIED. """ 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__() @@ -184,7 +234,7 @@ class DepositParams(betterproto.Message): max_deposit_period: timedelta = betterproto.message_field(2) """ Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - months. + months. """ @@ -193,7 +243,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) @@ -205,7 +255,7 @@ class TallyParams(betterproto.Message): quorum: bytes = betterproto.bytes_field(1) """ Minimum percentage of total stake needed to vote for a result to be - considered valid. + considered valid. """ threshold: bytes = betterproto.bytes_field(2) @@ -216,20 +266,27 @@ 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. + vetoed. Default value: 1/3. """ @dataclass(eq=False, repr=False) class MsgSubmitProposal(betterproto.Message): """ - MsgSubmitProposal defines an sdk.Msg type that supports submitting - arbitrary proposal Content. + MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + proposal Content. """ 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 +296,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 +304,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) @@ -260,19 +323,27 @@ class MsgVoteResponse(betterproto.Message): @dataclass(eq=False, repr=False) class MsgVoteWeighted(betterproto.Message): """ - MsgVoteWeighted defines a message to cast a vote. Since: cosmos-sdk 0.43 + MsgVoteWeighted defines a message to cast a vote. + + Since: cosmos-sdk 0.43 """ 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) class MsgVoteWeightedResponse(betterproto.Message): """ - MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. Since: - cosmos-sdk 0.43 + MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. + + Since: cosmos-sdk 0.43 """ pass @@ -285,8 +356,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) @@ -309,8 +385,7 @@ class QueryProposalRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryProposalResponse(betterproto.Message): """ - QueryProposalResponse is the response type for the Query/Proposal RPC - method. + QueryProposalResponse is the response type for the Query/Proposal RPC method. """ proposal: "Proposal" = betterproto.message_field(1) @@ -319,8 +394,7 @@ class QueryProposalResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryProposalsRequest(betterproto.Message): """ - QueryProposalsRequest is the request type for the Query/Proposals RPC - method. + QueryProposalsRequest is the request type for the Query/Proposals RPC method. """ proposal_status: "ProposalStatus" = betterproto.enum_field(1) @@ -340,10 +414,12 @@ class QueryProposalsRequest(betterproto.Message): class QueryProposalsResponse(betterproto.Message): """ QueryProposalsResponse is the response type for the Query/Proposals RPC - method. + 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.""" @@ -356,7 +432,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 +442,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 +465,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.""" @@ -404,7 +480,7 @@ class QueryParamsRequest(betterproto.Message): params_type: str = betterproto.string_field(1) """ params_type defines which parameters to query for, can be one of "voting", - "tallying" or "deposit". + "tallying" or "deposit". """ @@ -463,11 +539,12 @@ class QueryDepositsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryDepositsResponse(betterproto.Message): """ - QueryDepositsResponse is the response type for the Query/Deposits RPC - method. + 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.""" @@ -485,8 +562,7 @@ class QueryTallyResultRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryTallyResultResponse(betterproto.Message): """ - QueryTallyResultResponse is the response type for the Query/Tally RPC - method. + QueryTallyResultResponse is the response type for the Query/Tally RPC method. """ tally: "TallyResult" = betterproto.message_field(1) @@ -510,13 +586,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,13 +804,18 @@ async def tally_result( class MsgBase(ServiceBase): - async def submit_proposal(self, msg_submit_proposal: "MsgSubmitProposal") -> "MsgSubmitProposalResponse": + + async def submit_proposal( + self, msg_submit_proposal: "MsgSubmitProposal" + ) -> "MsgSubmitProposalResponse": 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": + 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": @@ -748,7 +829,9 @@ async def __rpc_submit_proposal( response = await self.submit_proposal(request) await stream.send_message(response) - async def __rpc_vote(self, stream: "grpclib.server.Stream[MsgVote, MsgVoteResponse]") -> None: + 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) @@ -760,7 +843,9 @@ async def __rpc_vote_weighted( response = await self.vote_weighted(request) await stream.send_message(response) - async def __rpc_deposit(self, stream: "grpclib.server.Stream[MsgDeposit, MsgDepositResponse]") -> None: + 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) @@ -795,28 +880,43 @@ def __mapping__(self) -> Dict[str, grpclib.const.Handler]: class QueryBase(ServiceBase): - async def proposal(self, query_proposal_request: "QueryProposalRequest") -> "QueryProposalResponse": + + 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": + 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": + 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": + 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": + 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": + 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": + async def tally_result( + self, query_tally_result_request: "QueryTallyResultRequest" + ) -> "QueryTallyResultResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def __rpc_proposal( @@ -835,22 +935,30 @@ async def __rpc_proposals( response = await self.proposals(request) await stream.send_message(response) - async def __rpc_vote(self, stream: "grpclib.server.Stream[QueryVoteRequest, QueryVoteResponse]") -> None: + 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: + 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: + 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: + 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) diff --git a/pyband/proto/cosmos/group/__init__.py b/pyband/proto/cosmos/group/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/group/module/__init__.py b/pyband/proto/cosmos/group/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/group/module/v1/__init__.py b/pyband/proto/cosmos/group/module/v1/__init__.py new file mode 100644 index 0000000..5aaf4ce --- /dev/null +++ b/pyband/proto/cosmos/group/module/v1/__init__.py @@ -0,0 +1,26 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/group/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass +from datetime import timedelta + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the group module.""" + + max_execution_period: timedelta = betterproto.message_field(1) + """ + max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec + to execute the proposal. + """ + + max_metadata_len: int = betterproto.uint64_field(2) + """ + max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. + Defaults to 255 if not explicitly set. + """ diff --git a/pyband/proto/cosmos/group/v1/__init__.py b/pyband/proto/cosmos/group/v1/__init__.py new file mode 100644 index 0000000..f44999b --- /dev/null +++ b/pyband/proto/cosmos/group/v1/__init__.py @@ -0,0 +1,2318 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/group/v1beta1/events.proto, cosmos/group/v1beta1/genesis.proto, cosmos/group/v1beta1/query.proto, cosmos/group/v1beta1/tx.proto, cosmos/group/v1beta1/types.proto +# plugin: python-betterproto +# This file has been @generated + +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 + + +class VoteOption(betterproto.Enum): + """VoteOption enumerates the valid vote options for a given proposal.""" + + UNSPECIFIED = 0 + """ + VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + return an error. + """ + + YES = 1 + """VOTE_OPTION_YES defines a yes vote option.""" + + ABSTAIN = 2 + """VOTE_OPTION_ABSTAIN defines an abstain vote option.""" + + NO = 3 + """VOTE_OPTION_NO defines a no vote option.""" + + NO_WITH_VETO = 4 + """VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option.""" + + +class ProposalStatus(betterproto.Enum): + """ProposalStatus defines proposal statuses.""" + + UNSPECIFIED = 0 + """An empty value is invalid and not allowed.""" + + SUBMITTED = 1 + """Initial status of a proposal when submitted.""" + + ACCEPTED = 2 + """ + Final status of a proposal when the final tally is done and the outcome + passes the group policy's decision policy. + """ + + REJECTED = 3 + """ + Final status of a proposal when the final tally is done and the outcome + is rejected by the group policy's decision policy. + """ + + ABORTED = 4 + """ + Final status of a proposal when the group policy is modified before the + final tally. + """ + + WITHDRAWN = 5 + """ + A proposal can be withdrawn before the voting start time by the owner. + When this happens the final status is Withdrawn. + """ + + +class ProposalExecutorResult(betterproto.Enum): + """ProposalExecutorResult defines types of proposal executor results.""" + + UNSPECIFIED = 0 + """An empty value is not allowed.""" + + NOT_RUN = 1 + """We have not yet run the executor.""" + + SUCCESS = 2 + """The executor was successful and proposed action updated state.""" + + FAILURE = 3 + """ + The executor returned an error and proposed action didn't update state. + """ + + +class Exec(betterproto.Enum): + """ + Exec defines modes of execution of a proposal on creation or on new vote. + """ + + UNSPECIFIED = 0 + """ + An empty value means that there should be a separate + MsgExec request for the proposal to execute. + """ + + TRY = 1 + """ + Try to execute the proposal immediately. + If the proposal is not allowed per the DecisionPolicy, + the proposal will still be open and could + be executed at a later point. + """ + + +@dataclass(eq=False, repr=False) +class Member(betterproto.Message): + """ + Member represents a group member with an account address, + non-zero weight, metadata and added_at timestamp. + """ + + address: str = betterproto.string_field(1) + """address is the member's account address.""" + + weight: str = betterproto.string_field(2) + """weight is the member's voting weight that should be greater than 0.""" + + metadata: str = betterproto.string_field(3) + """metadata is any arbitrary metadata attached to the member.""" + + added_at: datetime = betterproto.message_field(4) + """added_at is a timestamp specifying when a member was added.""" + + +@dataclass(eq=False, repr=False) +class MemberRequest(betterproto.Message): + """ + MemberRequest represents a group member to be used in Msg server requests. + Contrary to `Member`, it doesn't have any `added_at` field + since this field cannot be set as part of requests. + """ + + address: str = betterproto.string_field(1) + """address is the member's account address.""" + + weight: str = betterproto.string_field(2) + """weight is the member's voting weight that should be greater than 0.""" + + metadata: str = betterproto.string_field(3) + """metadata is any arbitrary metadata attached to the member.""" + + +@dataclass(eq=False, repr=False) +class ThresholdDecisionPolicy(betterproto.Message): + """ + ThresholdDecisionPolicy is a decision policy where a proposal passes when it + satisfies the two following conditions: + 1. The sum of all `YES` voter's weights is greater or equal than the defined + `threshold`. + 2. The voting and execution periods of the proposal respect the parameters + given by `windows`. + """ + + threshold: str = betterproto.string_field(1) + """ + threshold is the minimum weighted sum of `YES` votes that must be met or + exceeded for a proposal to succeed. + """ + + windows: "DecisionPolicyWindows" = betterproto.message_field(2) + """windows defines the different windows for voting and execution.""" + + +@dataclass(eq=False, repr=False) +class PercentageDecisionPolicy(betterproto.Message): + """ + PercentageDecisionPolicy is a decision policy where a proposal passes when + it satisfies the two following conditions: + 1. The percentage of all `YES` voters' weights out of the total group weight + is greater or equal than the given `percentage`. + 2. The voting and execution periods of the proposal respect the parameters + given by `windows`. + """ + + percentage: str = betterproto.string_field(1) + """ + percentage is the minimum percentage of the weighted sum of `YES` votes must + meet for a proposal to succeed. + """ + + windows: "DecisionPolicyWindows" = betterproto.message_field(2) + """windows defines the different windows for voting and execution.""" + + +@dataclass(eq=False, repr=False) +class DecisionPolicyWindows(betterproto.Message): + """ + DecisionPolicyWindows defines the different windows for voting and execution. + """ + + voting_period: timedelta = betterproto.message_field(1) + """ + voting_period is the duration from submission of a proposal to the end of voting period + Within this times votes can be submitted with MsgVote. + """ + + min_execution_period: timedelta = betterproto.message_field(2) + """ + min_execution_period is the minimum duration after the proposal submission + where members can start sending MsgExec. This means that the window for + sending a MsgExec transaction is: + `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + where max_execution_period is a app-specific config, defined in the keeper. + If not set, min_execution_period will default to 0. + + Please make sure to set a `min_execution_period` that is smaller than + `voting_period + max_execution_period`, or else the above execution window + is empty, meaning that all proposals created with this decision policy + won't be able to be executed. + """ + + +@dataclass(eq=False, repr=False) +class GroupInfo(betterproto.Message): + """ + GroupInfo represents the high-level on-chain information for a group. + """ + + id: int = betterproto.uint64_field(1) + """id is the unique ID of the group.""" + + admin: str = betterproto.string_field(2) + """admin is the account address of the group's admin.""" + + metadata: str = betterproto.string_field(3) + """ + metadata is any arbitrary metadata to attached to the group. + the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#group-1 + """ + + version: int = betterproto.uint64_field(4) + """ + version is used to track changes to a group's membership structure that + would break existing proposals. Whenever any members weight is changed, + or any member is added or removed this version is incremented and will + cause proposals based on older versions of this group to fail + """ + + total_weight: str = betterproto.string_field(5) + """total_weight is the sum of the group members' weights.""" + + created_at: datetime = betterproto.message_field(6) + """created_at is a timestamp specifying when a group was created.""" + + +@dataclass(eq=False, repr=False) +class GroupMember(betterproto.Message): + """ + GroupMember represents the relationship between a group and a member. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group.""" + + member: "Member" = betterproto.message_field(2) + """member is the member data.""" + + +@dataclass(eq=False, repr=False) +class GroupPolicyInfo(betterproto.Message): + """ + GroupPolicyInfo represents the high-level on-chain information for a group policy. + """ + + address: str = betterproto.string_field(1) + """address is the account address of group policy.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the unique ID of the group.""" + + admin: str = betterproto.string_field(3) + """admin is the account address of the group admin.""" + + metadata: str = betterproto.string_field(4) + """ + metadata is any arbitrary metadata attached to the group policy. + the recommended format of the metadata is to be found here: + https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + """ + + version: int = betterproto.uint64_field(5) + """ + version is used to track changes to a group's GroupPolicyInfo structure that + would create a different result on a running proposal. + """ + + decision_policy: "betterproto_lib_google_protobuf.Any" = betterproto.message_field( + 6 + ) + """decision_policy specifies the group policy's decision policy.""" + + created_at: datetime = betterproto.message_field(7) + """ + created_at is a timestamp specifying when a group policy was created. + """ + + +@dataclass(eq=False, repr=False) +class Proposal(betterproto.Message): + """ + Proposal defines a group proposal. Any member of a group can submit a proposal + for a group policy to decide upon. + A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + passes as well as some optional metadata associated with the proposal. + """ + + id: int = betterproto.uint64_field(1) + """id is the unique id of the proposal.""" + + group_policy_address: str = betterproto.string_field(2) + """group_policy_address is the account address of group policy.""" + + metadata: str = betterproto.string_field(3) + """ + 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/group#proposal-4 + """ + + proposers: List[str] = betterproto.string_field(4) + """proposers are the account addresses of the proposers.""" + + submit_time: datetime = betterproto.message_field(5) + """submit_time is a timestamp specifying when a proposal was submitted.""" + + group_version: int = betterproto.uint64_field(6) + """ + group_version tracks the version of the group at proposal submission. + This field is here for informational purposes only. + """ + + group_policy_version: int = betterproto.uint64_field(7) + """ + group_policy_version tracks the version of the group policy at proposal submission. + When a decision policy is changed, existing proposals from previous policy + versions will become invalid with the `ABORTED` status. + This field is here for informational purposes only. + """ + + status: "ProposalStatus" = betterproto.enum_field(8) + """ + status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + """ + + final_tally_result: "TallyResult" = betterproto.message_field(9) + """ + final_tally_result contains the sums of all weighted votes for this + proposal for each vote option. It is empty at submission, and only + populated after tallying, at voting period end or at proposal execution, + whichever happens first. + """ + + voting_period_end: datetime = betterproto.message_field(10) + """ + voting_period_end is the timestamp before which voting must be done. + Unless a successful MsgExec is called before (to execute a proposal whose + tally is successful before the voting period ends), tallying will be done + at this point, and the `final_tally_result`and `status` fields will be + accordingly updated. + """ + + executor_result: "ProposalExecutorResult" = betterproto.enum_field(11) + """ + executor_result is the final result of the proposal execution. Initial value is NotRun. + """ + + messages: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field( + 12 + ) + """ + messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + """ + + title: str = betterproto.string_field(13) + """ + title is the title of the proposal + + Since: cosmos-sdk 0.47 + """ + + summary: str = betterproto.string_field(14) + """ + summary is a short summary of the proposal + + Since: cosmos-sdk 0.47 + """ + + +@dataclass(eq=False, repr=False) +class TallyResult(betterproto.Message): + """ + TallyResult represents the sum of weighted votes for each vote option. + """ + + yes_count: str = betterproto.string_field(1) + """yes_count is the weighted sum of yes votes.""" + + abstain_count: str = betterproto.string_field(2) + """abstain_count is the weighted sum of abstainers.""" + + no_count: str = betterproto.string_field(3) + """no_count is the weighted sum of no votes.""" + + no_with_veto_count: str = betterproto.string_field(4) + """no_with_veto_count is the weighted sum of veto.""" + + +@dataclass(eq=False, repr=False) +class Vote(betterproto.Message): + """Vote represents a vote for a proposal.string metadata""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal is the unique ID of the proposal.""" + + voter: str = betterproto.string_field(2) + """voter is the account address of the voter.""" + + option: "VoteOption" = betterproto.enum_field(3) + """option is the voter's choice on the proposal.""" + + metadata: str = betterproto.string_field(4) + """ + 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/group#vote-2 + """ + + submit_time: datetime = betterproto.message_field(5) + """submit_time is the timestamp when the vote was submitted.""" + + +@dataclass(eq=False, repr=False) +class MsgCreateGroup(betterproto.Message): + """MsgCreateGroup is the Msg/CreateGroup request type.""" + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + members: List["MemberRequest"] = betterproto.message_field(2) + """members defines the group members.""" + + metadata: str = betterproto.string_field(3) + """metadata is any arbitrary metadata to attached to the group.""" + + +@dataclass(eq=False, repr=False) +class MsgCreateGroupResponse(betterproto.Message): + """MsgCreateGroupResponse is the Msg/CreateGroup response type.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the newly created group.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupMembers(betterproto.Message): + """MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type.""" + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the unique ID of the group.""" + + member_updates: List["MemberRequest"] = betterproto.message_field(3) + """ + member_updates is the list of members to update, + set weight to 0 to remove a member. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupMembersResponse(betterproto.Message): + """ + MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupAdmin(betterproto.Message): + """MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type.""" + + admin: str = betterproto.string_field(1) + """admin is the current account address of the group admin.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the unique ID of the group.""" + + new_admin: str = betterproto.string_field(3) + """new_admin is the group new admin account address.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupAdminResponse(betterproto.Message): + """ + MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupMetadata(betterproto.Message): + """MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type.""" + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the unique ID of the group.""" + + metadata: str = betterproto.string_field(3) + """metadata is the updated group's metadata.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupMetadataResponse(betterproto.Message): + """ + MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCreateGroupPolicy(betterproto.Message): + """MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type.""" + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the unique ID of the group.""" + + metadata: str = betterproto.string_field(3) + """metadata is any arbitrary metadata attached to the group policy.""" + + decision_policy: "betterproto_lib_google_protobuf.Any" = betterproto.message_field( + 4 + ) + """decision_policy specifies the group policy's decision policy.""" + + +@dataclass(eq=False, repr=False) +class MsgCreateGroupPolicyResponse(betterproto.Message): + """ + MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. + """ + + address: str = betterproto.string_field(1) + """address is the account address of the newly created group policy.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupPolicyAdmin(betterproto.Message): + """ + MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. + """ + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + group_policy_address: str = betterproto.string_field(2) + """group_policy_address is the account address of the group policy.""" + + new_admin: str = betterproto.string_field(3) + """new_admin is the new group policy admin.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupPolicyAdminResponse(betterproto.Message): + """ + MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgCreateGroupWithPolicy(betterproto.Message): + """ + MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. + """ + + admin: str = betterproto.string_field(1) + """admin is the account address of the group and group policy admin.""" + + members: List["MemberRequest"] = betterproto.message_field(2) + """members defines the group members.""" + + group_metadata: str = betterproto.string_field(3) + """group_metadata is any arbitrary metadata attached to the group.""" + + group_policy_metadata: str = betterproto.string_field(4) + """ + group_policy_metadata is any arbitrary metadata attached to the group policy. + """ + + group_policy_as_admin: bool = betterproto.bool_field(5) + """ + group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + and group policy admin. + """ + + decision_policy: "betterproto_lib_google_protobuf.Any" = betterproto.message_field( + 6 + ) + """decision_policy specifies the group policy's decision policy.""" + + +@dataclass(eq=False, repr=False) +class MsgCreateGroupWithPolicyResponse(betterproto.Message): + """ + MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the newly created group with policy.""" + + group_policy_address: str = betterproto.string_field(2) + """ + group_policy_address is the account address of the newly created group policy. + """ + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupPolicyDecisionPolicy(betterproto.Message): + """ + MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. + """ + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + group_policy_address: str = betterproto.string_field(2) + """group_policy_address is the account address of group policy.""" + + decision_policy: "betterproto_lib_google_protobuf.Any" = betterproto.message_field( + 3 + ) + """decision_policy is the updated group policy's decision policy.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupPolicyDecisionPolicyResponse(betterproto.Message): + """ + MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupPolicyMetadata(betterproto.Message): + """ + MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. + """ + + admin: str = betterproto.string_field(1) + """admin is the account address of the group admin.""" + + group_policy_address: str = betterproto.string_field(2) + """group_policy_address is the account address of group policy.""" + + metadata: str = betterproto.string_field(3) + """metadata is the group policy metadata to be updated.""" + + +@dataclass(eq=False, repr=False) +class MsgUpdateGroupPolicyMetadataResponse(betterproto.Message): + """ + MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgSubmitProposal(betterproto.Message): + """MsgSubmitProposal is the Msg/SubmitProposal request type.""" + + group_policy_address: str = betterproto.string_field(1) + """group_policy_address is the account address of group policy.""" + + proposers: List[str] = betterproto.string_field(2) + """ + proposers are the account addresses of the proposers. + Proposers signatures will be counted as yes votes. + """ + + metadata: str = betterproto.string_field(3) + """metadata is any arbitrary metadata attached to the proposal.""" + + messages: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(4) + """ + messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + """ + + exec: "Exec" = betterproto.enum_field(5) + """ + exec defines the mode of execution of the proposal, + whether it should be executed immediately on creation or not. + If so, proposers signatures are considered as Yes votes. + """ + + title: str = betterproto.string_field(6) + """ + title is the title of the proposal. + + Since: cosmos-sdk 0.47 + """ + + summary: str = betterproto.string_field(7) + """ + summary is the summary of the proposal. + + Since: cosmos-sdk 0.47 + """ + + +@dataclass(eq=False, repr=False) +class MsgSubmitProposalResponse(betterproto.Message): + """MsgSubmitProposalResponse is the Msg/SubmitProposal response type.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal is the unique ID of the proposal.""" + + +@dataclass(eq=False, repr=False) +class MsgWithdrawProposal(betterproto.Message): + """MsgWithdrawProposal is the Msg/WithdrawProposal request type.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal is the unique ID of the proposal.""" + + address: str = betterproto.string_field(2) + """ + address is the admin of the group policy or one of the proposer of the proposal. + """ + + +@dataclass(eq=False, repr=False) +class MsgWithdrawProposalResponse(betterproto.Message): + """ + MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. + """ + + pass + + +@dataclass(eq=False, repr=False) +class MsgVote(betterproto.Message): + """MsgVote is the Msg/Vote request type.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal is the unique ID of the proposal.""" + + voter: str = betterproto.string_field(2) + """voter is the voter account address.""" + + option: "VoteOption" = betterproto.enum_field(3) + """option is the voter's choice on the proposal.""" + + metadata: str = betterproto.string_field(4) + """metadata is any arbitrary metadata attached to the vote.""" + + exec: "Exec" = betterproto.enum_field(5) + """ + exec defines whether the proposal should be executed + immediately after voting or not. + """ + + +@dataclass(eq=False, repr=False) +class MsgVoteResponse(betterproto.Message): + """MsgVoteResponse is the Msg/Vote response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class MsgExec(betterproto.Message): + """MsgExec is the Msg/Exec request type.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal is the unique ID of the proposal.""" + + executor: str = betterproto.string_field(2) + """executor is the account address used to execute the proposal.""" + + +@dataclass(eq=False, repr=False) +class MsgExecResponse(betterproto.Message): + """MsgExecResponse is the Msg/Exec request type.""" + + result: "ProposalExecutorResult" = betterproto.enum_field(2) + """result is the final result of the proposal execution.""" + + +@dataclass(eq=False, repr=False) +class MsgLeaveGroup(betterproto.Message): + """MsgLeaveGroup is the Msg/LeaveGroup request type.""" + + address: str = betterproto.string_field(1) + """address is the account address of the group member.""" + + group_id: int = betterproto.uint64_field(2) + """group_id is the unique ID of the group.""" + + +@dataclass(eq=False, repr=False) +class MsgLeaveGroupResponse(betterproto.Message): + """MsgLeaveGroupResponse is the Msg/LeaveGroup response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class EventCreateGroup(betterproto.Message): + """EventCreateGroup is an event emitted when a group is created.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group.""" + + +@dataclass(eq=False, repr=False) +class EventUpdateGroup(betterproto.Message): + """EventUpdateGroup is an event emitted when a group is updated.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group.""" + + +@dataclass(eq=False, repr=False) +class EventCreateGroupPolicy(betterproto.Message): + """ + EventCreateGroupPolicy is an event emitted when a group policy is created. + """ + + address: str = betterproto.string_field(1) + """address is the account address of the group policy.""" + + +@dataclass(eq=False, repr=False) +class EventUpdateGroupPolicy(betterproto.Message): + """ + EventUpdateGroupPolicy is an event emitted when a group policy is updated. + """ + + address: str = betterproto.string_field(1) + """address is the account address of the group policy.""" + + +@dataclass(eq=False, repr=False) +class EventSubmitProposal(betterproto.Message): + """EventSubmitProposal is an event emitted when a proposal is created.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of the proposal.""" + + +@dataclass(eq=False, repr=False) +class EventWithdrawProposal(betterproto.Message): + """ + EventWithdrawProposal is an event emitted when a proposal is withdrawn. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of the proposal.""" + + +@dataclass(eq=False, repr=False) +class EventVote(betterproto.Message): + """EventVote is an event emitted when a voter votes on a proposal.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of the proposal.""" + + +@dataclass(eq=False, repr=False) +class EventExec(betterproto.Message): + """EventExec is an event emitted when a proposal is executed.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of the proposal.""" + + result: "ProposalExecutorResult" = betterproto.enum_field(2) + """result is the proposal execution result.""" + + logs: str = betterproto.string_field(3) + """logs contains error logs in case the execution result is FAILURE.""" + + +@dataclass(eq=False, repr=False) +class EventLeaveGroup(betterproto.Message): + """ + EventLeaveGroup is an event emitted when group member leaves the group. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group.""" + + address: str = betterproto.string_field(2) + """address is the account address of the group member.""" + + +@dataclass(eq=False, repr=False) +class EventProposalPruned(betterproto.Message): + """EventProposalPruned is an event emitted when a proposal is pruned.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of the proposal.""" + + status: "ProposalStatus" = betterproto.enum_field(2) + """ + status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + """ + + tally_result: "TallyResult" = betterproto.message_field(3) + """tally_result is the proposal tally result (when applicable).""" + + +@dataclass(eq=False, repr=False) +class QueryGroupInfoRequest(betterproto.Message): + """QueryGroupInfoRequest is the Query/GroupInfo request type.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupInfoResponse(betterproto.Message): + """QueryGroupInfoResponse is the Query/GroupInfo response type.""" + + info: "GroupInfo" = betterproto.message_field(1) + """info is the GroupInfo of the group.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupPolicyInfoRequest(betterproto.Message): + """ + QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. + """ + + address: str = betterproto.string_field(1) + """address is the account address of the group policy.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupPolicyInfoResponse(betterproto.Message): + """ + QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. + """ + + info: "GroupPolicyInfo" = betterproto.message_field(1) + """info is the GroupPolicyInfo of the group policy.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupMembersRequest(betterproto.Message): + """QueryGroupMembersRequest is the Query/GroupMembers request type.""" + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupMembersResponse(betterproto.Message): + """ + QueryGroupMembersResponse is the Query/GroupMembersResponse response type. + """ + + members: List["GroupMember"] = betterproto.message_field(1) + """members are the members of the group with given group_id.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsByAdminRequest(betterproto.Message): + """QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type.""" + + admin: str = betterproto.string_field(1) + """admin is the account address of a group's admin.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsByAdminResponse(betterproto.Message): + """ + QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. + """ + + groups: List["GroupInfo"] = betterproto.message_field(1) + """groups are the groups info with the provided admin.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupPoliciesByGroupRequest(betterproto.Message): + """ + QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. + """ + + group_id: int = betterproto.uint64_field(1) + """group_id is the unique ID of the group policy's group.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupPoliciesByGroupResponse(betterproto.Message): + """ + QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. + """ + + group_policies: List["GroupPolicyInfo"] = betterproto.message_field(1) + """ + group_policies are the group policies info associated with the provided group. + """ + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupPoliciesByAdminRequest(betterproto.Message): + """ + QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. + """ + + admin: str = betterproto.string_field(1) + """admin is the admin address of the group policy.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupPoliciesByAdminResponse(betterproto.Message): + """ + QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. + """ + + group_policies: List["GroupPolicyInfo"] = betterproto.message_field(1) + """group_policies are the group policies info with provided admin.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalRequest(betterproto.Message): + """QueryProposalRequest is the Query/Proposal request type.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of a proposal.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalResponse(betterproto.Message): + """QueryProposalResponse is the Query/Proposal response type.""" + + proposal: "Proposal" = betterproto.message_field(1) + """proposal is the proposal info.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalsByGroupPolicyRequest(betterproto.Message): + """ + QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. + """ + + address: str = betterproto.string_field(1) + """ + address is the account address of the group policy related to proposals. + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryProposalsByGroupPolicyResponse(betterproto.Message): + """ + QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. + """ + + proposals: List["Proposal"] = betterproto.message_field(1) + """proposals are the proposals with given group policy.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryVoteByProposalVoterRequest(betterproto.Message): + """ + QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of a proposal.""" + + voter: str = betterproto.string_field(2) + """voter is a proposal voter account address.""" + + +@dataclass(eq=False, repr=False) +class QueryVoteByProposalVoterResponse(betterproto.Message): + """ + QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. + """ + + vote: "Vote" = betterproto.message_field(1) + """vote is the vote with given proposal_id and voter.""" + + +@dataclass(eq=False, repr=False) +class QueryVotesByProposalRequest(betterproto.Message): + """ + QueryVotesByProposalRequest is the Query/VotesByProposal request type. + """ + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique ID of a 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 QueryVotesByProposalResponse(betterproto.Message): + """ + QueryVotesByProposalResponse is the Query/VotesByProposal response type. + """ + + votes: List["Vote"] = betterproto.message_field(1) + """votes are the list of votes for given proposal_id.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryVotesByVoterRequest(betterproto.Message): + """QueryVotesByVoterRequest is the Query/VotesByVoter request type.""" + + voter: str = betterproto.string_field(1) + """voter is a proposal voter account address.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryVotesByVoterResponse(betterproto.Message): + """QueryVotesByVoterResponse is the Query/VotesByVoter response type.""" + + votes: List["Vote"] = betterproto.message_field(1) + """votes are the list of votes by given voter.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsByMemberRequest(betterproto.Message): + """QueryGroupsByMemberRequest is the Query/GroupsByMember request type.""" + + address: str = betterproto.string_field(1) + """address is the group member address.""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsByMemberResponse(betterproto.Message): + """ + QueryGroupsByMemberResponse is the Query/GroupsByMember response type. + """ + + groups: List["GroupInfo"] = betterproto.message_field(1) + """groups are the groups info with the provided group member.""" + + 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 Query/TallyResult request type.""" + + proposal_id: int = betterproto.uint64_field(1) + """proposal_id is the unique id of a proposal.""" + + +@dataclass(eq=False, repr=False) +class QueryTallyResultResponse(betterproto.Message): + """QueryTallyResultResponse is the Query/TallyResult response type.""" + + tally: "TallyResult" = betterproto.message_field(1) + """tally defines the requested tally.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsRequest(betterproto.Message): + """ + QueryGroupsRequest is the Query/Groups request type. + + Since: cosmos-sdk 0.47.1 + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(2) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryGroupsResponse(betterproto.Message): + """ + QueryGroupsResponse is the Query/Groups response type. + + Since: cosmos-sdk 0.47.1 + """ + + groups: List["GroupInfo"] = betterproto.message_field(1) + """`groups` is all the groups present in state.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the group module's genesis state.""" + + group_seq: int = betterproto.uint64_field(1) + """ + group_seq is the group table orm.Sequence, + it is used to get the next group ID. + """ + + groups: List["GroupInfo"] = betterproto.message_field(2) + """groups is the list of groups info.""" + + group_members: List["GroupMember"] = betterproto.message_field(3) + """group_members is the list of groups members.""" + + group_policy_seq: int = betterproto.uint64_field(4) + """ + group_policy_seq is the group policy table orm.Sequence, + it is used to generate the next group policy account address. + """ + + group_policies: List["GroupPolicyInfo"] = betterproto.message_field(5) + """group_policies is the list of group policies info.""" + + proposal_seq: int = betterproto.uint64_field(6) + """ + proposal_seq is the proposal table orm.Sequence, + it is used to get the next proposal ID. + """ + + proposals: List["Proposal"] = betterproto.message_field(7) + """proposals is the list of proposals.""" + + votes: List["Vote"] = betterproto.message_field(8) + """votes is the list of votes.""" + + +class MsgStub(betterproto.ServiceStub): + async def create_group( + self, + msg_create_group: "MsgCreateGroup", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCreateGroupResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/CreateGroup", + msg_create_group, + MsgCreateGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_group_members( + self, + msg_update_group_members: "MsgUpdateGroupMembers", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateGroupMembersResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/UpdateGroupMembers", + msg_update_group_members, + MsgUpdateGroupMembersResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_group_admin( + self, + msg_update_group_admin: "MsgUpdateGroupAdmin", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateGroupAdminResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/UpdateGroupAdmin", + msg_update_group_admin, + MsgUpdateGroupAdminResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_group_metadata( + self, + msg_update_group_metadata: "MsgUpdateGroupMetadata", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateGroupMetadataResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/UpdateGroupMetadata", + msg_update_group_metadata, + MsgUpdateGroupMetadataResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def create_group_policy( + self, + msg_create_group_policy: "MsgCreateGroupPolicy", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCreateGroupPolicyResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/CreateGroupPolicy", + msg_create_group_policy, + MsgCreateGroupPolicyResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def create_group_with_policy( + self, + msg_create_group_with_policy: "MsgCreateGroupWithPolicy", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgCreateGroupWithPolicyResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/CreateGroupWithPolicy", + msg_create_group_with_policy, + MsgCreateGroupWithPolicyResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_group_policy_admin( + self, + msg_update_group_policy_admin: "MsgUpdateGroupPolicyAdmin", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateGroupPolicyAdminResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/UpdateGroupPolicyAdmin", + msg_update_group_policy_admin, + MsgUpdateGroupPolicyAdminResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_group_policy_decision_policy( + self, + msg_update_group_policy_decision_policy: "MsgUpdateGroupPolicyDecisionPolicy", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateGroupPolicyDecisionPolicyResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/UpdateGroupPolicyDecisionPolicy", + msg_update_group_policy_decision_policy, + MsgUpdateGroupPolicyDecisionPolicyResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def update_group_policy_metadata( + self, + msg_update_group_policy_metadata: "MsgUpdateGroupPolicyMetadata", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgUpdateGroupPolicyMetadataResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/UpdateGroupPolicyMetadata", + msg_update_group_policy_metadata, + MsgUpdateGroupPolicyMetadataResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + 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.group.v1beta1.Msg/SubmitProposal", + msg_submit_proposal, + MsgSubmitProposalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def withdraw_proposal( + self, + msg_withdraw_proposal: "MsgWithdrawProposal", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgWithdrawProposalResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/WithdrawProposal", + msg_withdraw_proposal, + MsgWithdrawProposalResponse, + 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.group.v1beta1.Msg/Vote", + msg_vote, + MsgVoteResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def exec( + self, + msg_exec: "MsgExec", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgExecResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/Exec", + msg_exec, + MsgExecResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def leave_group( + self, + msg_leave_group: "MsgLeaveGroup", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgLeaveGroupResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Msg/LeaveGroup", + msg_leave_group, + MsgLeaveGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def group_info( + self, + query_group_info_request: "QueryGroupInfoRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupInfoResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupInfo", + query_group_info_request, + QueryGroupInfoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def group_policy_info( + self, + query_group_policy_info_request: "QueryGroupPolicyInfoRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupPolicyInfoResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupPolicyInfo", + query_group_policy_info_request, + QueryGroupPolicyInfoResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def group_members( + self, + query_group_members_request: "QueryGroupMembersRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupMembersResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupMembers", + query_group_members_request, + QueryGroupMembersResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def groups_by_admin( + self, + query_groups_by_admin_request: "QueryGroupsByAdminRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupsByAdminResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupsByAdmin", + query_groups_by_admin_request, + QueryGroupsByAdminResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def group_policies_by_group( + self, + query_group_policies_by_group_request: "QueryGroupPoliciesByGroupRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupPoliciesByGroupResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupPoliciesByGroup", + query_group_policies_by_group_request, + QueryGroupPoliciesByGroupResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def group_policies_by_admin( + self, + query_group_policies_by_admin_request: "QueryGroupPoliciesByAdminRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupPoliciesByAdminResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupPoliciesByAdmin", + query_group_policies_by_admin_request, + QueryGroupPoliciesByAdminResponse, + 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.group.v1beta1.Query/Proposal", + query_proposal_request, + QueryProposalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def proposals_by_group_policy( + self, + query_proposals_by_group_policy_request: "QueryProposalsByGroupPolicyRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryProposalsByGroupPolicyResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/ProposalsByGroupPolicy", + query_proposals_by_group_policy_request, + QueryProposalsByGroupPolicyResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def vote_by_proposal_voter( + self, + query_vote_by_proposal_voter_request: "QueryVoteByProposalVoterRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVoteByProposalVoterResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/VoteByProposalVoter", + query_vote_by_proposal_voter_request, + QueryVoteByProposalVoterResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def votes_by_proposal( + self, + query_votes_by_proposal_request: "QueryVotesByProposalRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVotesByProposalResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/VotesByProposal", + query_votes_by_proposal_request, + QueryVotesByProposalResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def votes_by_voter( + self, + query_votes_by_voter_request: "QueryVotesByVoterRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryVotesByVoterResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/VotesByVoter", + query_votes_by_voter_request, + QueryVotesByVoterResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def groups_by_member( + self, + query_groups_by_member_request: "QueryGroupsByMemberRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupsByMemberResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/GroupsByMember", + query_groups_by_member_request, + QueryGroupsByMemberResponse, + 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.group.v1beta1.Query/TallyResult", + query_tally_result_request, + QueryTallyResultResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def groups( + self, + query_groups_request: "QueryGroupsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryGroupsResponse": + return await self._unary_unary( + "/cosmos.group.v1beta1.Query/Groups", + query_groups_request, + QueryGroupsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def create_group( + self, msg_create_group: "MsgCreateGroup" + ) -> "MsgCreateGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_group_members( + self, msg_update_group_members: "MsgUpdateGroupMembers" + ) -> "MsgUpdateGroupMembersResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_group_admin( + self, msg_update_group_admin: "MsgUpdateGroupAdmin" + ) -> "MsgUpdateGroupAdminResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_group_metadata( + self, msg_update_group_metadata: "MsgUpdateGroupMetadata" + ) -> "MsgUpdateGroupMetadataResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def create_group_policy( + self, msg_create_group_policy: "MsgCreateGroupPolicy" + ) -> "MsgCreateGroupPolicyResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def create_group_with_policy( + self, msg_create_group_with_policy: "MsgCreateGroupWithPolicy" + ) -> "MsgCreateGroupWithPolicyResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_group_policy_admin( + self, msg_update_group_policy_admin: "MsgUpdateGroupPolicyAdmin" + ) -> "MsgUpdateGroupPolicyAdminResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_group_policy_decision_policy( + self, + msg_update_group_policy_decision_policy: "MsgUpdateGroupPolicyDecisionPolicy", + ) -> "MsgUpdateGroupPolicyDecisionPolicyResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def update_group_policy_metadata( + self, msg_update_group_policy_metadata: "MsgUpdateGroupPolicyMetadata" + ) -> "MsgUpdateGroupPolicyMetadataResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def submit_proposal( + self, msg_submit_proposal: "MsgSubmitProposal" + ) -> "MsgSubmitProposalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def withdraw_proposal( + self, msg_withdraw_proposal: "MsgWithdrawProposal" + ) -> "MsgWithdrawProposalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def vote(self, msg_vote: "MsgVote") -> "MsgVoteResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def exec(self, msg_exec: "MsgExec") -> "MsgExecResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def leave_group( + self, msg_leave_group: "MsgLeaveGroup" + ) -> "MsgLeaveGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_create_group( + self, stream: "grpclib.server.Stream[MsgCreateGroup, MsgCreateGroupResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.create_group(request) + await stream.send_message(response) + + async def __rpc_update_group_members( + self, + stream: "grpclib.server.Stream[MsgUpdateGroupMembers, MsgUpdateGroupMembersResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_group_members(request) + await stream.send_message(response) + + async def __rpc_update_group_admin( + self, + stream: "grpclib.server.Stream[MsgUpdateGroupAdmin, MsgUpdateGroupAdminResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_group_admin(request) + await stream.send_message(response) + + async def __rpc_update_group_metadata( + self, + stream: "grpclib.server.Stream[MsgUpdateGroupMetadata, MsgUpdateGroupMetadataResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_group_metadata(request) + await stream.send_message(response) + + async def __rpc_create_group_policy( + self, + stream: "grpclib.server.Stream[MsgCreateGroupPolicy, MsgCreateGroupPolicyResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.create_group_policy(request) + await stream.send_message(response) + + async def __rpc_create_group_with_policy( + self, + stream: "grpclib.server.Stream[MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicyResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.create_group_with_policy(request) + await stream.send_message(response) + + async def __rpc_update_group_policy_admin( + self, + stream: "grpclib.server.Stream[MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_group_policy_admin(request) + await stream.send_message(response) + + async def __rpc_update_group_policy_decision_policy( + self, + stream: "grpclib.server.Stream[MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicyResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_group_policy_decision_policy(request) + await stream.send_message(response) + + async def __rpc_update_group_policy_metadata( + self, + stream: "grpclib.server.Stream[MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.update_group_policy_metadata(request) + await stream.send_message(response) + + 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_withdraw_proposal( + self, + stream: "grpclib.server.Stream[MsgWithdrawProposal, MsgWithdrawProposalResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.withdraw_proposal(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_exec( + self, stream: "grpclib.server.Stream[MsgExec, MsgExecResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.exec(request) + await stream.send_message(response) + + async def __rpc_leave_group( + self, stream: "grpclib.server.Stream[MsgLeaveGroup, MsgLeaveGroupResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.leave_group(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.group.v1beta1.Msg/CreateGroup": grpclib.const.Handler( + self.__rpc_create_group, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCreateGroup, + MsgCreateGroupResponse, + ), + "/cosmos.group.v1beta1.Msg/UpdateGroupMembers": grpclib.const.Handler( + self.__rpc_update_group_members, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateGroupMembers, + MsgUpdateGroupMembersResponse, + ), + "/cosmos.group.v1beta1.Msg/UpdateGroupAdmin": grpclib.const.Handler( + self.__rpc_update_group_admin, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateGroupAdmin, + MsgUpdateGroupAdminResponse, + ), + "/cosmos.group.v1beta1.Msg/UpdateGroupMetadata": grpclib.const.Handler( + self.__rpc_update_group_metadata, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateGroupMetadata, + MsgUpdateGroupMetadataResponse, + ), + "/cosmos.group.v1beta1.Msg/CreateGroupPolicy": grpclib.const.Handler( + self.__rpc_create_group_policy, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCreateGroupPolicy, + MsgCreateGroupPolicyResponse, + ), + "/cosmos.group.v1beta1.Msg/CreateGroupWithPolicy": grpclib.const.Handler( + self.__rpc_create_group_with_policy, + grpclib.const.Cardinality.UNARY_UNARY, + MsgCreateGroupWithPolicy, + MsgCreateGroupWithPolicyResponse, + ), + "/cosmos.group.v1beta1.Msg/UpdateGroupPolicyAdmin": grpclib.const.Handler( + self.__rpc_update_group_policy_admin, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateGroupPolicyAdmin, + MsgUpdateGroupPolicyAdminResponse, + ), + "/cosmos.group.v1beta1.Msg/UpdateGroupPolicyDecisionPolicy": grpclib.const.Handler( + self.__rpc_update_group_policy_decision_policy, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateGroupPolicyDecisionPolicy, + MsgUpdateGroupPolicyDecisionPolicyResponse, + ), + "/cosmos.group.v1beta1.Msg/UpdateGroupPolicyMetadata": grpclib.const.Handler( + self.__rpc_update_group_policy_metadata, + grpclib.const.Cardinality.UNARY_UNARY, + MsgUpdateGroupPolicyMetadata, + MsgUpdateGroupPolicyMetadataResponse, + ), + "/cosmos.group.v1beta1.Msg/SubmitProposal": grpclib.const.Handler( + self.__rpc_submit_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSubmitProposal, + MsgSubmitProposalResponse, + ), + "/cosmos.group.v1beta1.Msg/WithdrawProposal": grpclib.const.Handler( + self.__rpc_withdraw_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + MsgWithdrawProposal, + MsgWithdrawProposalResponse, + ), + "/cosmos.group.v1beta1.Msg/Vote": grpclib.const.Handler( + self.__rpc_vote, + grpclib.const.Cardinality.UNARY_UNARY, + MsgVote, + MsgVoteResponse, + ), + "/cosmos.group.v1beta1.Msg/Exec": grpclib.const.Handler( + self.__rpc_exec, + grpclib.const.Cardinality.UNARY_UNARY, + MsgExec, + MsgExecResponse, + ), + "/cosmos.group.v1beta1.Msg/LeaveGroup": grpclib.const.Handler( + self.__rpc_leave_group, + grpclib.const.Cardinality.UNARY_UNARY, + MsgLeaveGroup, + MsgLeaveGroupResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def group_info( + self, query_group_info_request: "QueryGroupInfoRequest" + ) -> "QueryGroupInfoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def group_policy_info( + self, query_group_policy_info_request: "QueryGroupPolicyInfoRequest" + ) -> "QueryGroupPolicyInfoResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def group_members( + self, query_group_members_request: "QueryGroupMembersRequest" + ) -> "QueryGroupMembersResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def groups_by_admin( + self, query_groups_by_admin_request: "QueryGroupsByAdminRequest" + ) -> "QueryGroupsByAdminResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def group_policies_by_group( + self, query_group_policies_by_group_request: "QueryGroupPoliciesByGroupRequest" + ) -> "QueryGroupPoliciesByGroupResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def group_policies_by_admin( + self, query_group_policies_by_admin_request: "QueryGroupPoliciesByAdminRequest" + ) -> "QueryGroupPoliciesByAdminResponse": + 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_by_group_policy( + self, + query_proposals_by_group_policy_request: "QueryProposalsByGroupPolicyRequest", + ) -> "QueryProposalsByGroupPolicyResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def vote_by_proposal_voter( + self, query_vote_by_proposal_voter_request: "QueryVoteByProposalVoterRequest" + ) -> "QueryVoteByProposalVoterResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def votes_by_proposal( + self, query_votes_by_proposal_request: "QueryVotesByProposalRequest" + ) -> "QueryVotesByProposalResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def votes_by_voter( + self, query_votes_by_voter_request: "QueryVotesByVoterRequest" + ) -> "QueryVotesByVoterResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def groups_by_member( + self, query_groups_by_member_request: "QueryGroupsByMemberRequest" + ) -> "QueryGroupsByMemberResponse": + 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 groups( + self, query_groups_request: "QueryGroupsRequest" + ) -> "QueryGroupsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_group_info( + self, + stream: "grpclib.server.Stream[QueryGroupInfoRequest, QueryGroupInfoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.group_info(request) + await stream.send_message(response) + + async def __rpc_group_policy_info( + self, + stream: "grpclib.server.Stream[QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.group_policy_info(request) + await stream.send_message(response) + + async def __rpc_group_members( + self, + stream: "grpclib.server.Stream[QueryGroupMembersRequest, QueryGroupMembersResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.group_members(request) + await stream.send_message(response) + + async def __rpc_groups_by_admin( + self, + stream: "grpclib.server.Stream[QueryGroupsByAdminRequest, QueryGroupsByAdminResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.groups_by_admin(request) + await stream.send_message(response) + + async def __rpc_group_policies_by_group( + self, + stream: "grpclib.server.Stream[QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.group_policies_by_group(request) + await stream.send_message(response) + + async def __rpc_group_policies_by_admin( + self, + stream: "grpclib.server.Stream[QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.group_policies_by_admin(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_by_group_policy( + self, + stream: "grpclib.server.Stream[QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.proposals_by_group_policy(request) + await stream.send_message(response) + + async def __rpc_vote_by_proposal_voter( + self, + stream: "grpclib.server.Stream[QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.vote_by_proposal_voter(request) + await stream.send_message(response) + + async def __rpc_votes_by_proposal( + self, + stream: "grpclib.server.Stream[QueryVotesByProposalRequest, QueryVotesByProposalResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.votes_by_proposal(request) + await stream.send_message(response) + + async def __rpc_votes_by_voter( + self, + stream: "grpclib.server.Stream[QueryVotesByVoterRequest, QueryVotesByVoterResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.votes_by_voter(request) + await stream.send_message(response) + + async def __rpc_groups_by_member( + self, + stream: "grpclib.server.Stream[QueryGroupsByMemberRequest, QueryGroupsByMemberResponse]", + ) -> None: + request = await stream.recv_message() + response = await self.groups_by_member(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) + + async def __rpc_groups( + self, stream: "grpclib.server.Stream[QueryGroupsRequest, QueryGroupsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.groups(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.group.v1beta1.Query/GroupInfo": grpclib.const.Handler( + self.__rpc_group_info, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupInfoRequest, + QueryGroupInfoResponse, + ), + "/cosmos.group.v1beta1.Query/GroupPolicyInfo": grpclib.const.Handler( + self.__rpc_group_policy_info, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupPolicyInfoRequest, + QueryGroupPolicyInfoResponse, + ), + "/cosmos.group.v1beta1.Query/GroupMembers": grpclib.const.Handler( + self.__rpc_group_members, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupMembersRequest, + QueryGroupMembersResponse, + ), + "/cosmos.group.v1beta1.Query/GroupsByAdmin": grpclib.const.Handler( + self.__rpc_groups_by_admin, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupsByAdminRequest, + QueryGroupsByAdminResponse, + ), + "/cosmos.group.v1beta1.Query/GroupPoliciesByGroup": grpclib.const.Handler( + self.__rpc_group_policies_by_group, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupPoliciesByGroupRequest, + QueryGroupPoliciesByGroupResponse, + ), + "/cosmos.group.v1beta1.Query/GroupPoliciesByAdmin": grpclib.const.Handler( + self.__rpc_group_policies_by_admin, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupPoliciesByAdminRequest, + QueryGroupPoliciesByAdminResponse, + ), + "/cosmos.group.v1beta1.Query/Proposal": grpclib.const.Handler( + self.__rpc_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + QueryProposalRequest, + QueryProposalResponse, + ), + "/cosmos.group.v1beta1.Query/ProposalsByGroupPolicy": grpclib.const.Handler( + self.__rpc_proposals_by_group_policy, + grpclib.const.Cardinality.UNARY_UNARY, + QueryProposalsByGroupPolicyRequest, + QueryProposalsByGroupPolicyResponse, + ), + "/cosmos.group.v1beta1.Query/VoteByProposalVoter": grpclib.const.Handler( + self.__rpc_vote_by_proposal_voter, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVoteByProposalVoterRequest, + QueryVoteByProposalVoterResponse, + ), + "/cosmos.group.v1beta1.Query/VotesByProposal": grpclib.const.Handler( + self.__rpc_votes_by_proposal, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVotesByProposalRequest, + QueryVotesByProposalResponse, + ), + "/cosmos.group.v1beta1.Query/VotesByVoter": grpclib.const.Handler( + self.__rpc_votes_by_voter, + grpclib.const.Cardinality.UNARY_UNARY, + QueryVotesByVoterRequest, + QueryVotesByVoterResponse, + ), + "/cosmos.group.v1beta1.Query/GroupsByMember": grpclib.const.Handler( + self.__rpc_groups_by_member, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupsByMemberRequest, + QueryGroupsByMemberResponse, + ), + "/cosmos.group.v1beta1.Query/TallyResult": grpclib.const.Handler( + self.__rpc_tally_result, + grpclib.const.Cardinality.UNARY_UNARY, + QueryTallyResultRequest, + QueryTallyResultResponse, + ), + "/cosmos.group.v1beta1.Query/Groups": grpclib.const.Handler( + self.__rpc_groups, + grpclib.const.Cardinality.UNARY_UNARY, + QueryGroupsRequest, + QueryGroupsResponse, + ), + } diff --git a/pyband/proto/cosmos/mint/module/__init__.py b/pyband/proto/cosmos/mint/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/mint/module/v1/__init__.py b/pyband/proto/cosmos/mint/module/v1/__init__.py new file mode 100644 index 0000000..cef8d03 --- /dev/null +++ b/pyband/proto/cosmos/mint/module/v1/__init__.py @@ -0,0 +1,19 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/mint/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/mint/v1beta1/__init__.py b/pyband/proto/cosmos/mint/v1beta1/__init__.py index a0dc874..8b31b2b 100644 --- a/pyband/proto/cosmos/mint/v1beta1/__init__.py +++ b/pyband/proto/cosmos/mint/v1beta1/__init__.py @@ -1,6 +1,8 @@ # 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 +# This file has been @generated + from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -32,7 +34,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 +55,39 @@ 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): """ @@ -75,8 +110,7 @@ class QueryParamsResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryInflationRequest(betterproto.Message): """ - QueryInflationRequest is the request type for the Query/Inflation RPC - method. + QueryInflationRequest is the request type for the Query/Inflation RPC method. """ pass @@ -86,7 +120,7 @@ class QueryInflationRequest(betterproto.Message): class QueryInflationResponse(betterproto.Message): """ QueryInflationResponse is the response type for the Query/Inflation RPC - method. + method. """ inflation: bytes = betterproto.bytes_field(1) @@ -97,7 +131,7 @@ class QueryInflationResponse(betterproto.Message): class QueryAnnualProvisionsRequest(betterproto.Message): """ QueryAnnualProvisionsRequest is the request type for the - Query/AnnualProvisions RPC method. + Query/AnnualProvisions RPC method. """ pass @@ -107,7 +141,7 @@ class QueryAnnualProvisionsRequest(betterproto.Message): class QueryAnnualProvisionsResponse(betterproto.Message): """ QueryAnnualProvisionsResponse is the response type for the - Query/AnnualProvisions RPC method. + Query/AnnualProvisions RPC method. """ annual_provisions: bytes = betterproto.bytes_field(1) @@ -122,7 +156,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,11 +231,41 @@ 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": + + async def params( + self, query_params_request: "QueryParamsRequest" + ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def inflation(self, query_inflation_request: "QueryInflationRequest") -> "QueryInflationResponse": + async def inflation( + self, query_inflation_request: "QueryInflationRequest" + ) -> "QueryInflationResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def annual_provisions( @@ -190,7 +273,9 @@ async def annual_provisions( ) -> "QueryAnnualProvisionsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_params(self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]") -> None: + 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) diff --git a/pyband/proto/cosmos/msg/__init__.py b/pyband/proto/cosmos/msg/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/msg/textual/__init__.py b/pyband/proto/cosmos/msg/textual/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/msg/textual/v1/__init__.py b/pyband/proto/cosmos/msg/textual/v1/__init__.py new file mode 100644 index 0000000..e805a6c --- /dev/null +++ b/pyband/proto/cosmos/msg/textual/v1/__init__.py @@ -0,0 +1,8 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/msg/textual/v1beta1/textual.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto diff --git a/pyband/proto/cosmos/msg/v1/__init__.py b/pyband/proto/cosmos/msg/v1/__init__.py new file mode 100644 index 0000000..34be9f8 --- /dev/null +++ b/pyband/proto/cosmos/msg/v1/__init__.py @@ -0,0 +1,8 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/msg/v1beta1/msg.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto diff --git a/pyband/proto/cosmos/nft/__init__.py b/pyband/proto/cosmos/nft/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/nft/module/__init__.py b/pyband/proto/cosmos/nft/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/nft/module/v1/__init__.py b/pyband/proto/cosmos/nft/module/v1/__init__.py new file mode 100644 index 0000000..b2857bd --- /dev/null +++ b/pyband/proto/cosmos/nft/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/nft/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto + + +@dataclass(eq=False, repr=False) +class Module(betterproto.Message): + """Module is the config object of the nft module.""" + + pass diff --git a/pyband/proto/cosmos/nft/v1beta1/__init__.py b/pyband/proto/cosmos/nft/v1beta1/__init__.py new file mode 100644 index 0000000..36c737f --- /dev/null +++ b/pyband/proto/cosmos/nft/v1beta1/__init__.py @@ -0,0 +1,619 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/nft/v1beta1/event.proto, cosmos/nft/v1beta1/genesis.proto, cosmos/nft/v1beta1/nft.proto, cosmos/nft/v1beta1/query.proto, cosmos/nft/v1beta1/tx.proto +# plugin: python-betterproto +# This file has been @generated + +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 + +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 MsgSend(betterproto.Message): + """ + MsgSend represents a message to send a nft from one account to another account. + """ + + class_id: str = betterproto.string_field(1) + """ + class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + """ + + id: str = betterproto.string_field(2) + """id defines the unique identification of nft""" + + sender: str = betterproto.string_field(3) + """sender is the address of the owner of nft""" + + receiver: str = betterproto.string_field(4) + """receiver is the receiver address of nft""" + + +@dataclass(eq=False, repr=False) +class MsgSendResponse(betterproto.Message): + """MsgSendResponse defines the Msg/Send response type.""" + + pass + + +@dataclass(eq=False, repr=False) +class Class(betterproto.Message): + """Class defines the class of the nft type.""" + + id: str = betterproto.string_field(1) + """ + id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + """ + + name: str = betterproto.string_field(2) + """ + name defines the human-readable name of the NFT classification. Optional + """ + + symbol: str = betterproto.string_field(3) + """symbol is an abbreviated name for nft classification. Optional""" + + description: str = betterproto.string_field(4) + """description is a brief description of nft classification. Optional""" + + uri: str = betterproto.string_field(5) + """ + uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + """ + + uri_hash: str = betterproto.string_field(6) + """uri_hash is a hash of the document pointed by uri. Optional""" + + data: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(7) + """data is the app specific metadata of the NFT class. Optional""" + + +@dataclass(eq=False, repr=False) +class Nft(betterproto.Message): + """NFT defines the NFT.""" + + class_id: str = betterproto.string_field(1) + """ + class_id associated with the NFT, similar to the contract address of ERC721 + """ + + id: str = betterproto.string_field(2) + """id is a unique identifier of the NFT""" + + uri: str = betterproto.string_field(3) + """uri for the NFT metadata stored off chain""" + + uri_hash: str = betterproto.string_field(4) + """uri_hash is a hash of the document pointed by uri""" + + data: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(10) + """data is an app specific data of the NFT. Optional""" + + +@dataclass(eq=False, repr=False) +class QueryBalanceRequest(betterproto.Message): + """ + QueryBalanceRequest is the request type for the Query/Balance RPC method + """ + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + owner: str = betterproto.string_field(2) + """owner is the owner address of the nft""" + + +@dataclass(eq=False, repr=False) +class QueryBalanceResponse(betterproto.Message): + """ + QueryBalanceResponse is the response type for the Query/Balance RPC method + """ + + amount: int = betterproto.uint64_field(1) + """amount is the number of all NFTs of a given class owned by the owner""" + + +@dataclass(eq=False, repr=False) +class QueryOwnerRequest(betterproto.Message): + """QueryOwnerRequest is the request type for the Query/Owner RPC method""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + id: str = betterproto.string_field(2) + """id is a unique identifier of the NFT""" + + +@dataclass(eq=False, repr=False) +class QueryOwnerResponse(betterproto.Message): + """ + QueryOwnerResponse is the response type for the Query/Owner RPC method + """ + + owner: str = betterproto.string_field(1) + """owner is the owner address of the nft""" + + +@dataclass(eq=False, repr=False) +class QuerySupplyRequest(betterproto.Message): + """ + QuerySupplyRequest is the request type for the Query/Supply RPC method + """ + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + +@dataclass(eq=False, repr=False) +class QuerySupplyResponse(betterproto.Message): + """ + QuerySupplyResponse is the response type for the Query/Supply RPC method + """ + + amount: int = betterproto.uint64_field(1) + """amount is the number of all NFTs from the given class""" + + +@dataclass(eq=False, repr=False) +class QueryNfTsRequest(betterproto.Message): + """QueryNFTstRequest is the request type for the Query/NFTs RPC method""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + owner: str = betterproto.string_field(2) + """owner is the owner address of the nft""" + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(3) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryNfTsResponse(betterproto.Message): + """ + QueryNFTsResponse is the response type for the Query/NFTs RPC methods + """ + + nfts: List["Nft"] = betterproto.message_field(1) + """NFT defines the NFT""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class QueryNftRequest(betterproto.Message): + """QueryNFTRequest is the request type for the Query/NFT RPC method""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + id: str = betterproto.string_field(2) + """id is a unique identifier of the NFT""" + + +@dataclass(eq=False, repr=False) +class QueryNftResponse(betterproto.Message): + """QueryNFTResponse is the response type for the Query/NFT RPC method""" + + nft: "Nft" = betterproto.message_field(1) + """owner is the owner address of the nft""" + + +@dataclass(eq=False, repr=False) +class QueryClassRequest(betterproto.Message): + """QueryClassRequest is the request type for the Query/Class RPC method""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + +@dataclass(eq=False, repr=False) +class QueryClassResponse(betterproto.Message): + """ + QueryClassResponse is the response type for the Query/Class RPC method + """ + + class_: "Class" = betterproto.message_field(1) + """class defines the class of the nft type.""" + + +@dataclass(eq=False, repr=False) +class QueryClassesRequest(betterproto.Message): + """ + QueryClassesRequest is the request type for the Query/Classes RPC method + """ + + pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) + """pagination defines an optional pagination for the request.""" + + +@dataclass(eq=False, repr=False) +class QueryClassesResponse(betterproto.Message): + """ + QueryClassesResponse is the response type for the Query/Classes RPC method + """ + + classes: List["Class"] = betterproto.message_field(1) + """class defines the class of the nft type.""" + + pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(2) + """pagination defines the pagination in the response.""" + + +@dataclass(eq=False, repr=False) +class EventSend(betterproto.Message): + """EventSend is emitted on Msg/Send""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + id: str = betterproto.string_field(2) + """id is a unique identifier of the nft""" + + sender: str = betterproto.string_field(3) + """sender is the address of the owner of nft""" + + receiver: str = betterproto.string_field(4) + """receiver is the receiver address of nft""" + + +@dataclass(eq=False, repr=False) +class EventMint(betterproto.Message): + """EventMint is emitted on Mint""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + id: str = betterproto.string_field(2) + """id is a unique identifier of the nft""" + + owner: str = betterproto.string_field(3) + """owner is the owner address of the nft""" + + +@dataclass(eq=False, repr=False) +class EventBurn(betterproto.Message): + """EventBurn is emitted on Burn""" + + class_id: str = betterproto.string_field(1) + """class_id associated with the nft""" + + id: str = betterproto.string_field(2) + """id is a unique identifier of the nft""" + + owner: str = betterproto.string_field(3) + """owner is the owner address of the nft""" + + +@dataclass(eq=False, repr=False) +class GenesisState(betterproto.Message): + """GenesisState defines the nft module's genesis state.""" + + classes: List["Class"] = betterproto.message_field(1) + """class defines the class of the nft type.""" + + entries: List["Entry"] = betterproto.message_field(2) + """entry defines all nft owned by a person.""" + + +@dataclass(eq=False, repr=False) +class Entry(betterproto.Message): + """Entry Defines all nft owned by a person""" + + owner: str = betterproto.string_field(1) + """owner is the owner address of the following nft""" + + nfts: List["Nft"] = betterproto.message_field(2) + """nfts is a group of nfts of the same owner""" + + +class MsgStub(betterproto.ServiceStub): + async def send( + self, + msg_send: "MsgSend", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "MsgSendResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Msg/Send", + msg_send, + MsgSendResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class QueryStub(betterproto.ServiceStub): + async def balance( + self, + query_balance_request: "QueryBalanceRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryBalanceResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/Balance", + query_balance_request, + QueryBalanceResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def owner( + self, + query_owner_request: "QueryOwnerRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryOwnerResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/Owner", + query_owner_request, + QueryOwnerResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def supply( + self, + query_supply_request: "QuerySupplyRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QuerySupplyResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/Supply", + query_supply_request, + QuerySupplyResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def nf_ts( + self, + query_nf_ts_request: "QueryNfTsRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryNfTsResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/NFTs", + query_nf_ts_request, + QueryNfTsResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def nft( + self, + query_nft_request: "QueryNftRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryNftResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/NFT", + query_nft_request, + QueryNftResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def class_( + self, + query_class_request: "QueryClassRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryClassResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/Class", + query_class_request, + QueryClassResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def classes( + self, + query_classes_request: "QueryClassesRequest", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "QueryClassesResponse": + return await self._unary_unary( + "/cosmos.nft.v1beta1.Query/Classes", + query_classes_request, + QueryClassesResponse, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + +class MsgBase(ServiceBase): + + async def send(self, msg_send: "MsgSend") -> "MsgSendResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_send( + self, stream: "grpclib.server.Stream[MsgSend, MsgSendResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.send(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.nft.v1beta1.Msg/Send": grpclib.const.Handler( + self.__rpc_send, + grpclib.const.Cardinality.UNARY_UNARY, + MsgSend, + MsgSendResponse, + ), + } + + +class QueryBase(ServiceBase): + + async def balance( + self, query_balance_request: "QueryBalanceRequest" + ) -> "QueryBalanceResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def owner( + self, query_owner_request: "QueryOwnerRequest" + ) -> "QueryOwnerResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def supply( + self, query_supply_request: "QuerySupplyRequest" + ) -> "QuerySupplyResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def nf_ts( + self, query_nf_ts_request: "QueryNfTsRequest" + ) -> "QueryNfTsResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def nft(self, query_nft_request: "QueryNftRequest") -> "QueryNftResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def class_( + self, query_class_request: "QueryClassRequest" + ) -> "QueryClassResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def classes( + self, query_classes_request: "QueryClassesRequest" + ) -> "QueryClassesResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def __rpc_balance( + self, stream: "grpclib.server.Stream[QueryBalanceRequest, QueryBalanceResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.balance(request) + await stream.send_message(response) + + async def __rpc_owner( + self, stream: "grpclib.server.Stream[QueryOwnerRequest, QueryOwnerResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.owner(request) + await stream.send_message(response) + + async def __rpc_supply( + self, stream: "grpclib.server.Stream[QuerySupplyRequest, QuerySupplyResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.supply(request) + await stream.send_message(response) + + async def __rpc_nf_ts( + self, stream: "grpclib.server.Stream[QueryNfTsRequest, QueryNfTsResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.nf_ts(request) + await stream.send_message(response) + + async def __rpc_nft( + self, stream: "grpclib.server.Stream[QueryNftRequest, QueryNftResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.nft(request) + await stream.send_message(response) + + async def __rpc_class_( + self, stream: "grpclib.server.Stream[QueryClassRequest, QueryClassResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.class_(request) + await stream.send_message(response) + + async def __rpc_classes( + self, stream: "grpclib.server.Stream[QueryClassesRequest, QueryClassesResponse]" + ) -> None: + request = await stream.recv_message() + response = await self.classes(request) + await stream.send_message(response) + + def __mapping__(self) -> Dict[str, grpclib.const.Handler]: + return { + "/cosmos.nft.v1beta1.Query/Balance": grpclib.const.Handler( + self.__rpc_balance, + grpclib.const.Cardinality.UNARY_UNARY, + QueryBalanceRequest, + QueryBalanceResponse, + ), + "/cosmos.nft.v1beta1.Query/Owner": grpclib.const.Handler( + self.__rpc_owner, + grpclib.const.Cardinality.UNARY_UNARY, + QueryOwnerRequest, + QueryOwnerResponse, + ), + "/cosmos.nft.v1beta1.Query/Supply": grpclib.const.Handler( + self.__rpc_supply, + grpclib.const.Cardinality.UNARY_UNARY, + QuerySupplyRequest, + QuerySupplyResponse, + ), + "/cosmos.nft.v1beta1.Query/NFTs": grpclib.const.Handler( + self.__rpc_nf_ts, + grpclib.const.Cardinality.UNARY_UNARY, + QueryNfTsRequest, + QueryNfTsResponse, + ), + "/cosmos.nft.v1beta1.Query/NFT": grpclib.const.Handler( + self.__rpc_nft, + grpclib.const.Cardinality.UNARY_UNARY, + QueryNftRequest, + QueryNftResponse, + ), + "/cosmos.nft.v1beta1.Query/Class": grpclib.const.Handler( + self.__rpc_class_, + grpclib.const.Cardinality.UNARY_UNARY, + QueryClassRequest, + QueryClassResponse, + ), + "/cosmos.nft.v1beta1.Query/Classes": grpclib.const.Handler( + self.__rpc_classes, + grpclib.const.Cardinality.UNARY_UNARY, + QueryClassesRequest, + QueryClassesResponse, + ), + } diff --git a/pyband/proto/cosmos/orm/__init__.py b/pyband/proto/cosmos/orm/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/orm/module/__init__.py b/pyband/proto/cosmos/orm/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/orm/module/v1alpha1/__init__.py b/pyband/proto/cosmos/orm/module/v1alpha1/__init__.py new file mode 100644 index 0000000..012ba15 --- /dev/null +++ b/pyband/proto/cosmos/orm/module/v1alpha1/__init__.py @@ -0,0 +1,19 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/module/v1alpha1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/orm/query/__init__.py b/pyband/proto/cosmos/orm/query/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/orm/query/v1alpha1/__init__.py b/pyband/proto/cosmos/orm/query/v1alpha1/__init__.py new file mode 100644 index 0000000..54f7bce --- /dev/null +++ b/pyband/proto/cosmos/orm/query/v1alpha1/__init__.py @@ -0,0 +1,243 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/query/v1alpha1/query.proto +# plugin: python-betterproto +# This file has been @generated +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/pyband/proto/cosmos/orm/v1/__init__.py b/pyband/proto/cosmos/orm/v1/__init__.py new file mode 100644 index 0000000..f5858d2 --- /dev/null +++ b/pyband/proto/cosmos/orm/v1/__init__.py @@ -0,0 +1,118 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/v1beta1/orm.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/orm/v1alpha1/__init__.py b/pyband/proto/cosmos/orm/v1alpha1/__init__.py new file mode 100644 index 0000000..fac4c46 --- /dev/null +++ b/pyband/proto/cosmos/orm/v1alpha1/__init__.py @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/orm/v1alpha1/schema.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass +from typing import List + +import betterproto + + +class StorageType(betterproto.Enum): + """StorageType""" + + DEFAULT_UNSPECIFIED = 0 + """ + STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all + data is stored in the regular Merkle-tree backed KV-store. + """ + + 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. + """ + + 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.v1beta1.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/pyband/proto/cosmos/params/module/__init__.py b/pyband/proto/cosmos/params/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/params/module/v1/__init__.py b/pyband/proto/cosmos/params/module/v1/__init__.py new file mode 100644 index 0000000..1af529f --- /dev/null +++ b/pyband/proto/cosmos/params/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/params/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/params/v1beta1/__init__.py b/pyband/proto/cosmos/params/v1beta1/__init__.py index cc39f3f..7ecb330 100644 --- a/pyband/proto/cosmos/params/v1beta1/__init__.py +++ b/pyband/proto/cosmos/params/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/params/v1beta1/params.proto, cosmos/params/v1beta1/query.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -23,8 +25,7 @@ @dataclass(eq=False, repr=False) class ParameterChangeProposal(betterproto.Message): """ - ParameterChangeProposal defines a proposal to change one or more - parameters. + ParameterChangeProposal defines a proposal to change one or more parameters. """ title: str = betterproto.string_field(1) @@ -36,7 +37,7 @@ class ParameterChangeProposal(betterproto.Message): class ParamChange(betterproto.Message): """ ParamChange defines an individual parameter change, for use in - ParameterChangeProposal. + ParameterChangeProposal. """ subspace: str = betterproto.string_field(1) @@ -65,6 +66,43 @@ 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,16 +121,51 @@ 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": + + 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: + 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: request = await stream.recv_message() 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( @@ -101,4 +174,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/pyband/proto/cosmos/query/__init__.py b/pyband/proto/cosmos/query/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/query/v1/__init__.py b/pyband/proto/cosmos/query/v1/__init__.py new file mode 100644 index 0000000..ce85d67 --- /dev/null +++ b/pyband/proto/cosmos/query/v1/__init__.py @@ -0,0 +1,8 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/query/v1beta1/query.proto +# plugin: python-betterproto +# This file has been @generated + +from dataclasses import dataclass + +import betterproto diff --git a/pyband/proto/cosmos/reflection/__init__.py b/pyband/proto/cosmos/reflection/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/reflection/v1/__init__.py b/pyband/proto/cosmos/reflection/v1/__init__.py new file mode 100644 index 0000000..0ae71d3 --- /dev/null +++ b/pyband/proto/cosmos/reflection/v1/__init__.py @@ -0,0 +1,85 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/reflection/v1beta1/reflection.proto +# plugin: python-betterproto +# This file has been @generated + +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.v1beta1.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.v1beta1.ReflectionService/FileDescriptors": grpclib.const.Handler( + self.__rpc_file_descriptors, + grpclib.const.Cardinality.UNARY_UNARY, + FileDescriptorsRequest, + FileDescriptorsResponse, + ), + } diff --git a/pyband/proto/cosmos/slashing/module/__init__.py b/pyband/proto/cosmos/slashing/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/slashing/module/v1/__init__.py b/pyband/proto/cosmos/slashing/module/v1/__init__.py new file mode 100644 index 0000000..55d34a7 --- /dev/null +++ b/pyband/proto/cosmos/slashing/module/v1/__init__.py @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/slashing/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/slashing/v1beta1/__init__.py b/pyband/proto/cosmos/slashing/v1beta1/__init__.py index b660e2f..b0135a2 100644 --- a/pyband/proto/cosmos/slashing/v1beta1/__init__.py +++ b/pyband/proto/cosmos/slashing/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/slashing/v1beta1/genesis.proto, cosmos/slashing/v1beta1/query.proto, cosmos/slashing/v1beta1/slashing.proto, cosmos/slashing/v1beta1/tx.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from datetime import ( datetime, @@ -26,37 +28,22 @@ 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): """ - ValidatorSigningInfo defines a validator's signing info for monitoring - their liveness activity. + ValidatorSigningInfo defines a validator's signing info for monitoring their + liveness activity. """ 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) @@ -67,14 +54,14 @@ class ValidatorSigningInfo(betterproto.Message): tombstoned: bool = betterproto.bool_field(5) """ 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. + set). It is set once the validator commits an equivocation or for any other + 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 +76,53 @@ 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): """ @@ -111,7 +145,7 @@ class QueryParamsResponse(betterproto.Message): class QuerySigningInfoRequest(betterproto.Message): """ QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC - method + method """ cons_address: str = betterproto.string_field(1) @@ -122,7 +156,7 @@ class QuerySigningInfoRequest(betterproto.Message): class QuerySigningInfoResponse(betterproto.Message): """ QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC - method + method """ val_signing_info: "ValidatorSigningInfo" = betterproto.message_field(1) @@ -133,7 +167,7 @@ class QuerySigningInfoResponse(betterproto.Message): class QuerySigningInfosRequest(betterproto.Message): """ QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC - method + method """ pagination: "__base_query_v1_beta1__.PageRequest" = betterproto.message_field(1) @@ -142,8 +176,8 @@ class QuerySigningInfosRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QuerySigningInfosResponse(betterproto.Message): """ - QuerySigningInfosResponse is the response type for the Query/SigningInfos - RPC method + QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC + method """ info: List["ValidatorSigningInfo"] = betterproto.message_field(1) @@ -157,18 +191,18 @@ 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) """ signing_infos represents a map between validator addresses and their - signing infos. + signing infos. """ missed_blocks: List["ValidatorMissedBlocks"] = betterproto.message_field(3) """ - missed_blocks represents a map between validator addresses and their missed - blocks. + missed_blocks represents a map between validator addresses and their + missed blocks. """ @@ -189,7 +223,7 @@ class SigningInfo(betterproto.Message): class ValidatorMissedBlocks(betterproto.Message): """ ValidatorMissedBlocks contains array of missed blocks of corresponding - address. + address. """ address: str = betterproto.string_field(1) @@ -228,6 +262,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,14 +334,29 @@ async def signing_infos( class MsgBase(ServiceBase): + async def unjail(self, msg_unjail: "MsgUnjail") -> "MsgUnjailResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_unjail(self, stream: "grpclib.server.Stream[MsgUnjail, MsgUnjailResponse]") -> None: + 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: request = await stream.recv_message() 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( @@ -299,14 +365,25 @@ 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": + + async def params( + self, query_params_request: "QueryParamsRequest" + ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def signing_info(self, query_signing_info_request: "QuerySigningInfoRequest") -> "QuerySigningInfoResponse": + async def signing_info( + self, query_signing_info_request: "QuerySigningInfoRequest" + ) -> "QuerySigningInfoResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def signing_infos( @@ -314,7 +391,9 @@ async def signing_infos( ) -> "QuerySigningInfosResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_params(self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]") -> None: + 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) diff --git a/pyband/proto/cosmos/staking/module/__init__.py b/pyband/proto/cosmos/staking/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/staking/module/v1/__init__.py b/pyband/proto/cosmos/staking/module/v1/__init__.py new file mode 100644 index 0000000..74b12d6 --- /dev/null +++ b/pyband/proto/cosmos/staking/module/v1/__init__.py @@ -0,0 +1,34 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/staking/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/staking/v1beta1/__init__.py b/pyband/proto/cosmos/staking/v1beta1/__init__.py index e711e19..1d65a84 100644 --- a/pyband/proto/cosmos/staking/v1beta1/__init__.py +++ b/pyband/proto/cosmos/staking/v1beta1/__init__.py @@ -1,6 +1,8 @@ # 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 +# This file has been @generated +import warnings from dataclasses import dataclass from datetime import ( datetime, @@ -18,7 +20,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__ @@ -32,45 +37,62 @@ class BondStatus(betterproto.Enum): """BondStatus is the status of a validator.""" - BOND_STATUS_UNSPECIFIED = 0 + UNSPECIFIED = 0 """UNSPECIFIED defines an invalid validator status.""" - BOND_STATUS_UNBONDED = 1 + UNBONDED = 1 """UNBONDED defines a validator that is not bonded.""" - BOND_STATUS_UNBONDING = 2 + UNBONDING = 2 """UNBONDING defines a validator that is unbonding.""" - BOND_STATUS_BONDED = 3 + BONDED = 3 """BONDED defines a validator that is bonded.""" +class Infraction(betterproto.Enum): + """Infraction indicates the infraction a validator commited.""" + + UNSPECIFIED = 0 + """UNSPECIFIED defines an empty infraction.""" + + DOUBLE_SIGN = 1 + """DOUBLE_SIGN defines a validator that double-signs a block.""" + + 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 - Since: cosmos-sdk 0.43 + + Since: cosmos-sdk 0.43 """ - AUTHORIZATION_TYPE_UNSPECIFIED = 0 + UNSPECIFIED = 0 """ AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type """ - AUTHORIZATION_TYPE_DELEGATE = 1 + DELEGATE = 1 """ AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate """ - AUTHORIZATION_TYPE_UNDELEGATE = 2 + UNDELEGATE = 2 + """ + AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + """ + + REDELEGATE = 3 """ - AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for - Msg/Undelegate + AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate """ - AUTHORIZATION_TYPE_REDELEGATE = 3 + CANCEL_UNBONDING_DELEGATION = 4 """ - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for - Msg/BeginRedelegate + AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation """ @@ -78,20 +100,20 @@ class AuthorizationType(betterproto.Enum): class HistoricalInfo(betterproto.Message): """ HistoricalInfo contains header and validator information for a given block. - It is stored as part of staking module's state, which persists the `n` most - recent HistoricalInfo (`n` is set by the staking module's - `historical_entries` parameter). + It is stored as part of staking module's state, which persists the `n` most + recent HistoricalInfo + (`n` is set by the staking module's `historical_entries` parameter). """ - header: "___tendermint_types__.Header" = betterproto.message_field(1) + header: "__tendermint_types__.Header" = betterproto.message_field(1) valset: List["Validator"] = betterproto.message_field(2) @dataclass(eq=False, repr=False) class CommissionRates(betterproto.Message): """ - CommissionRates defines the initial commission rates to be used for - creating a validator. + CommissionRates defines the initial commission rates to be used for creating + a validator. """ rate: str = betterproto.string_field(1) @@ -99,14 +121,12 @@ class CommissionRates(betterproto.Message): max_rate: str = betterproto.string_field(2) """ - max_rate defines the maximum commission rate which validator can ever - charge, as a fraction. + max_rate defines the maximum commission rate which validator can ever charge, as a fraction. """ max_change_rate: str = betterproto.string_field(3) """ - max_change_rate defines the maximum daily increase of the validator - commission, as a fraction. + max_change_rate defines the maximum daily increase of the validator commission, as a fraction. """ @@ -116,8 +136,7 @@ class Commission(betterproto.Message): commission_rates: "CommissionRates" = betterproto.message_field(1) """ - commission_rates defines the initial commission rates to be used for - creating a validator. + commission_rates defines the initial commission rates to be used for creating a validator. """ update_time: datetime = betterproto.message_field(2) @@ -150,31 +169,30 @@ class Description(betterproto.Message): class Validator(betterproto.Message): """ Validator defines a validator, together with the total amount of the - Validator's bond shares and their exchange rate to coins. Slashing results - in a decrease in the exchange rate, allowing correct calculation of future - undelegations without iterating over delegators. When coins are delegated - to this validator, the validator is credited with a delegation whose number - of bond shares is based on the amount of coins delegated divided by the - current exchange rate. Voting power can be calculated as total bonded - shares multiplied by exchange rate. + Validator's bond shares and their exchange rate to coins. Slashing results in + a decrease in the exchange rate, allowing correct calculation of future + undelegations without iterating over delegators. When coins are delegated to + this validator, the validator is credited with a delegation whose number of + bond shares is based on the amount of coins delegated divided by the current + exchange rate. Voting power can be calculated as total bonded shares + multiplied by exchange rate. """ operator_address: str = betterproto.string_field(1) """ - operator_address defines the address of the validator's operator; bech - encoded in JSON. + operator_address defines the address of the validator's operator; bech encoded in JSON. """ - consensus_pubkey: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(2) + consensus_pubkey: "betterproto_lib_google_protobuf.Any" = betterproto.message_field( + 2 + ) """ - consensus_pubkey is the consensus public key of the validator, as a - Protobuf Any. + consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. """ jailed: bool = betterproto.bool_field(3) """ - jailed defined whether the validator has been jailed from bonded status or - not. + jailed defined whether the validator has been jailed from bonded status or not. """ status: "BondStatus" = betterproto.enum_field(4) @@ -193,14 +211,12 @@ class Validator(betterproto.Message): unbonding_height: int = betterproto.int64_field(8) """ - unbonding_height defines, if unbonding, the height at which this validator - has begun unbonding. + unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. """ unbonding_time: datetime = betterproto.message_field(9) """ - unbonding_time defines, if unbonding, the min time for the validator to - complete unbonding. + unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. """ commission: "Commission" = betterproto.message_field(10) @@ -208,8 +224,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. + min_self_delegation is the validator's self declared minimum self 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 """ @@ -223,10 +250,9 @@ class ValAddresses(betterproto.Message): @dataclass(eq=False, repr=False) class DvPair(betterproto.Message): """ - DVPair is struct that just has a delegator-validator pair with no other - data. It is intended to be used as a marshalable pointer. For example, a - DVPair can be used to construct the key to getting an UnbondingDelegation - from state. + DVPair is struct that just has a delegator-validator pair with no other data. + It is intended to be used as a marshalable pointer. For example, a DVPair can + be used to construct the key to getting an UnbondingDelegation from state. """ delegator_address: str = betterproto.string_field(1) @@ -244,9 +270,9 @@ class DvPairs(betterproto.Message): class DvvTriplet(betterproto.Message): """ DVVTriplet is struct that just has a delegator-validator-validator triplet - with no other data. It is intended to be used as a marshalable pointer. For - example, a DVVTriplet can be used to construct the key to getting a - Redelegation from state. + with no other data. It is intended to be used as a marshalable pointer. For + example, a DVVTriplet can be used to construct the key to getting a + Redelegation from state. """ delegator_address: str = betterproto.string_field(1) @@ -264,15 +290,16 @@ class DvvTriplets(betterproto.Message): @dataclass(eq=False, repr=False) class Delegation(betterproto.Message): """ - Delegation represents the bond with tokens held by an account. It is owned - by one delegator, and is associated with the voting power of one validator. + Delegation represents the bond with tokens held by an account. It is + owned by one delegator, and is associated with the voting power of one + validator. """ 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.""" @@ -281,15 +308,15 @@ class Delegation(betterproto.Message): @dataclass(eq=False, repr=False) class UnbondingDelegation(betterproto.Message): """ - UnbondingDelegation stores all of a single delegator's unbonding bonds for - a single validator in an time-ordered list. + UnbondingDelegation stores all of a single delegator's unbonding bonds + for a single validator in an time-ordered list. """ 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.""" @@ -298,8 +325,7 @@ class UnbondingDelegation(betterproto.Message): @dataclass(eq=False, repr=False) class UnbondingDelegationEntry(betterproto.Message): """ - UnbondingDelegationEntry defines an unbonding object with relevant - metadata. + UnbondingDelegationEntry defines an unbonding object with relevant metadata. """ creation_height: int = betterproto.int64_field(1) @@ -310,13 +336,20 @@ class UnbondingDelegationEntry(betterproto.Message): initial_balance: str = betterproto.string_field(3) """ - initial_balance defines the tokens initially scheduled to receive at - completion. + initial_balance defines the tokens initially scheduled to receive at completion. """ 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): @@ -339,17 +372,23 @@ class RedelegationEntry(betterproto.Message): shares_dst: str = betterproto.string_field(4) """ - shares_dst is the amount of destination-validator shares created by - redelegation. + shares_dst is the amount of destination-validator shares created by 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): """ - Redelegation contains the list of a particular delegator's redelegating - bonds from a particular source validator to a particular destination - validator. + Redelegation contains the list of a particular delegator's redelegating bonds + from a particular source validator to a particular destination validator. """ delegator_address: str = betterproto.string_field(1) @@ -357,14 +396,12 @@ class Redelegation(betterproto.Message): validator_src_address: str = betterproto.string_field(2) """ - validator_src_address is the validator redelegation source operator - address. + validator_src_address is the validator redelegation source operator address. """ validator_dst_address: str = betterproto.string_field(3) """ - validator_dst_address is the validator redelegation destination operator - address. + validator_dst_address is the validator redelegation destination operator address. """ entries: List["RedelegationEntry"] = betterproto.message_field(4) @@ -373,7 +410,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.""" @@ -383,8 +420,7 @@ class Params(betterproto.Message): max_entries: int = betterproto.uint32_field(3) """ - max_entries is the max entries for either unbonding delegation or - redelegation (per pair/trio). + max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). """ historical_entries: int = betterproto.uint32_field(4) @@ -393,12 +429,17 @@ 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): """ DelegationResponse is equivalent to Delegation except that it contains a - balance in addition to shares which is more suitable for client responses. + balance in addition to shares which is more suitable for client responses. """ delegation: "Delegation" = betterproto.message_field(1) @@ -408,9 +449,9 @@ class DelegationResponse(betterproto.Message): @dataclass(eq=False, repr=False) class RedelegationEntryResponse(betterproto.Message): """ - RedelegationEntryResponse is equivalent to a RedelegationEntry except that - it contains a balance in addition to shares which is more suitable for - client responses. + RedelegationEntryResponse is equivalent to a RedelegationEntry except that it + contains a balance in addition to shares which is more suitable for client + responses. """ redelegation_entry: "RedelegationEntry" = betterproto.message_field(1) @@ -420,9 +461,9 @@ class RedelegationEntryResponse(betterproto.Message): @dataclass(eq=False, repr=False) class RedelegationResponse(betterproto.Message): """ - RedelegationResponse is equivalent to a Redelegation except that its - entries contain a balance in addition to shares which is more suitable for - client responses. + RedelegationResponse is equivalent to a Redelegation except that its entries + contain a balance in addition to shares which is more suitable for client + responses. """ redelegation: "Redelegation" = betterproto.message_field(1) @@ -433,13 +474,23 @@ class RedelegationResponse(betterproto.Message): class Pool(betterproto.Message): """ Pool is used for tracking bonded and not-bonded token supply of the bond - denomination. + denomination. """ not_bonded_tokens: str = betterproto.string_field(1) 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 MsgCreateValidator(betterproto.Message): """ @@ -450,10 +501,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): @@ -475,8 +539,9 @@ class MsgEditValidator(betterproto.Message): commission_rate: str = betterproto.string_field(3) """ We pass a reference to the new commission rate and min self delegation as - it's not mandatory to update. If not updated, the deserialized rate will be - zero with no way to distinguish if an update was intended. REF: #2373 + it's not mandatory to update. If not updated, the deserialized rate will be + zero with no way to distinguish if an update was intended. + REF: #2373 """ min_self_delegation: str = betterproto.string_field(4) @@ -494,8 +559,8 @@ class MsgEditValidatorResponse(betterproto.Message): @dataclass(eq=False, repr=False) class MsgDelegate(betterproto.Message): """ - MsgDelegate defines a SDK message for performing a delegation of coins from - a delegator to a validator. + MsgDelegate defines a SDK message for performing a delegation of coins + from a delegator to a validator. """ delegator_address: str = betterproto.string_field(1) @@ -513,8 +578,8 @@ class MsgDelegateResponse(betterproto.Message): @dataclass(eq=False, repr=False) class MsgBeginRedelegate(betterproto.Message): """ - MsgBeginRedelegate defines a SDK message for performing a redelegation of - coins from a delegator and source validator to a destination validator. + MsgBeginRedelegate defines a SDK message for performing a redelegation + of coins from a delegator and source validator to a destination validator. """ delegator_address: str = betterproto.string_field(1) @@ -536,7 +601,7 @@ class MsgBeginRedelegateResponse(betterproto.Message): class MsgUndelegate(betterproto.Message): """ MsgUndelegate defines a SDK message for performing an undelegation from a - delegate and a validator. + delegate and a validator. """ delegator_address: str = betterproto.string_field(1) @@ -549,6 +614,75 @@ 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) @@ -567,8 +701,7 @@ class QueryValidatorsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryValidatorsResponse(betterproto.Message): """ - QueryValidatorsResponse is response type for the Query/Validators RPC - method + QueryValidatorsResponse is response type for the Query/Validators RPC method """ validators: List["Validator"] = betterproto.message_field(1) @@ -595,14 +728,14 @@ 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) class QueryValidatorDelegationsRequest(betterproto.Message): """ QueryValidatorDelegationsRequest is request type for the - Query/ValidatorDelegations RPC method + Query/ValidatorDelegations RPC method """ validator_addr: str = betterproto.string_field(1) @@ -616,7 +749,7 @@ class QueryValidatorDelegationsRequest(betterproto.Message): class QueryValidatorDelegationsResponse(betterproto.Message): """ QueryValidatorDelegationsResponse is response type for the - Query/ValidatorDelegations RPC method + Query/ValidatorDelegations RPC method """ delegation_responses: List["DelegationResponse"] = betterproto.message_field(1) @@ -628,7 +761,7 @@ class QueryValidatorDelegationsResponse(betterproto.Message): class QueryValidatorUnbondingDelegationsRequest(betterproto.Message): """ QueryValidatorUnbondingDelegationsRequest is required type for the - Query/ValidatorUnbondingDelegations RPC method + Query/ValidatorUnbondingDelegations RPC method """ validator_addr: str = betterproto.string_field(1) @@ -642,7 +775,7 @@ class QueryValidatorUnbondingDelegationsRequest(betterproto.Message): class QueryValidatorUnbondingDelegationsResponse(betterproto.Message): """ QueryValidatorUnbondingDelegationsResponse is response type for the - Query/ValidatorUnbondingDelegations RPC method. + Query/ValidatorUnbondingDelegations RPC method. """ unbonding_responses: List["UnbondingDelegation"] = betterproto.message_field(1) @@ -666,8 +799,7 @@ class QueryDelegationRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryDelegationResponse(betterproto.Message): """ - QueryDelegationResponse is response type for the Query/Delegation RPC - method. + QueryDelegationResponse is response type for the Query/Delegation RPC method. """ delegation_response: "DelegationResponse" = betterproto.message_field(1) @@ -678,7 +810,7 @@ class QueryDelegationResponse(betterproto.Message): class QueryUnbondingDelegationRequest(betterproto.Message): """ QueryUnbondingDelegationRequest is request type for the - Query/UnbondingDelegation RPC method. + Query/UnbondingDelegation RPC method. """ delegator_addr: str = betterproto.string_field(1) @@ -692,7 +824,7 @@ class QueryUnbondingDelegationRequest(betterproto.Message): class QueryUnbondingDelegationResponse(betterproto.Message): """ QueryDelegationResponse is response type for the Query/UnbondingDelegation - RPC method. + RPC method. """ unbond: "UnbondingDelegation" = betterproto.message_field(1) @@ -703,7 +835,7 @@ class QueryUnbondingDelegationResponse(betterproto.Message): class QueryDelegatorDelegationsRequest(betterproto.Message): """ QueryDelegatorDelegationsRequest is request type for the - Query/DelegatorDelegations RPC method. + Query/DelegatorDelegations RPC method. """ delegator_addr: str = betterproto.string_field(1) @@ -717,7 +849,7 @@ class QueryDelegatorDelegationsRequest(betterproto.Message): class QueryDelegatorDelegationsResponse(betterproto.Message): """ QueryDelegatorDelegationsResponse is response type for the - Query/DelegatorDelegations RPC method. + Query/DelegatorDelegations RPC method. """ delegation_responses: List["DelegationResponse"] = betterproto.message_field(1) @@ -733,7 +865,7 @@ class QueryDelegatorDelegationsResponse(betterproto.Message): class QueryDelegatorUnbondingDelegationsRequest(betterproto.Message): """ QueryDelegatorUnbondingDelegationsRequest is request type for the - Query/DelegatorUnbondingDelegations RPC method. + Query/DelegatorUnbondingDelegations RPC method. """ delegator_addr: str = betterproto.string_field(1) @@ -747,7 +879,7 @@ class QueryDelegatorUnbondingDelegationsRequest(betterproto.Message): class QueryDelegatorUnbondingDelegationsResponse(betterproto.Message): """ QueryUnbondingDelegatorDelegationsResponse is response type for the - Query/UnbondingDelegatorDelegations RPC method. + Query/UnbondingDelegatorDelegations RPC method. """ unbonding_responses: List["UnbondingDelegation"] = betterproto.message_field(1) @@ -759,7 +891,7 @@ class QueryDelegatorUnbondingDelegationsResponse(betterproto.Message): class QueryRedelegationsRequest(betterproto.Message): """ QueryRedelegationsRequest is request type for the Query/Redelegations RPC - method. + method. """ delegator_addr: str = betterproto.string_field(1) @@ -779,7 +911,7 @@ class QueryRedelegationsRequest(betterproto.Message): class QueryRedelegationsResponse(betterproto.Message): """ QueryRedelegationsResponse is response type for the Query/Redelegations RPC - method. + method. """ redelegation_responses: List["RedelegationResponse"] = betterproto.message_field(1) @@ -791,7 +923,7 @@ class QueryRedelegationsResponse(betterproto.Message): class QueryDelegatorValidatorsRequest(betterproto.Message): """ QueryDelegatorValidatorsRequest is request type for the - Query/DelegatorValidators RPC method. + Query/DelegatorValidators RPC method. """ delegator_addr: str = betterproto.string_field(1) @@ -805,11 +937,11 @@ class QueryDelegatorValidatorsRequest(betterproto.Message): class QueryDelegatorValidatorsResponse(betterproto.Message): """ QueryDelegatorValidatorsResponse is response type for the - Query/DelegatorValidators RPC method. + Query/DelegatorValidators RPC method. """ 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.""" @@ -819,7 +951,7 @@ class QueryDelegatorValidatorsResponse(betterproto.Message): class QueryDelegatorValidatorRequest(betterproto.Message): """ QueryDelegatorValidatorRequest is request type for the - Query/DelegatorValidator RPC method. + Query/DelegatorValidator RPC method. """ delegator_addr: str = betterproto.string_field(1) @@ -833,18 +965,18 @@ class QueryDelegatorValidatorRequest(betterproto.Message): class QueryDelegatorValidatorResponse(betterproto.Message): """ QueryDelegatorValidatorResponse response type for the - Query/DelegatorValidator RPC method. + Query/DelegatorValidator RPC method. """ validator: "Validator" = betterproto.message_field(1) - """validator defines the the validator info.""" + """validator defines the validator info.""" @dataclass(eq=False, repr=False) class QueryHistoricalInfoRequest(betterproto.Message): """ QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC - method. + method. """ height: int = betterproto.int64_field(1) @@ -854,8 +986,8 @@ class QueryHistoricalInfoRequest(betterproto.Message): @dataclass(eq=False, repr=False) class QueryHistoricalInfoResponse(betterproto.Message): """ - QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo - RPC method. + QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC + method. """ hist: "HistoricalInfo" = betterproto.message_field(1) @@ -897,27 +1029,30 @@ class QueryParamsResponse(betterproto.Message): @dataclass(eq=False, repr=False) class StakeAuthorization(betterproto.Message): """ - StakeAuthorization defines authorization for - delegate/undelegate/redelegate. Since: cosmos-sdk 0.43 + 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. + 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: "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. + 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: "StakeAuthorizationValidators" = betterproto.message_field( + 3, group="validators" + ) """ - deny_list specifies list of validator addresses to whom grantee can not - delegate tokens. + deny_list specifies list of validator addresses to whom grantee can not delegate tokens. """ authorization_type: "AuthorizationType" = betterproto.enum_field(4) @@ -936,22 +1071,22 @@ 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) """ last_total_power tracks the total amounts of bonded tokens recorded during - the previous end block. + the previous end block. """ last_validator_powers: List["LastValidatorPower"] = betterproto.message_field(3) """ - last_validator_powers is a special index that provides a historical list of - the last-block's bonded validators. + last_validator_powers is a special index that provides a historical list + of the last-block's bonded validators. """ 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.""" @@ -965,6 +1100,9 @@ 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) @@ -1064,6 +1202,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( @@ -1306,19 +1478,38 @@ async def params( class MsgBase(ServiceBase): - async def create_validator(self, msg_create_validator: "MsgCreateValidator") -> "MsgCreateValidatorResponse": + + async def create_validator( + self, msg_create_validator: "MsgCreateValidator" + ) -> "MsgCreateValidatorResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def edit_validator(self, msg_edit_validator: "MsgEditValidator") -> "MsgEditValidatorResponse": + async def edit_validator( + self, msg_edit_validator: "MsgEditValidator" + ) -> "MsgEditValidatorResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def delegate(self, msg_delegate: "MsgDelegate") -> "MsgDelegateResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def begin_redelegate(self, msg_begin_redelegate: "MsgBeginRedelegate") -> "MsgBeginRedelegateResponse": + async def begin_redelegate( + self, msg_begin_redelegate: "MsgBeginRedelegate" + ) -> "MsgBeginRedelegateResponse": + raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) + + async def undelegate( + self, msg_undelegate: "MsgUndelegate" + ) -> "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 undelegate(self, msg_undelegate: "MsgUndelegate") -> "MsgUndelegateResponse": + async def update_params( + self, msg_update_params: "MsgUpdateParams" + ) -> "MsgUpdateParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def __rpc_create_validator( @@ -1337,7 +1528,9 @@ async def __rpc_edit_validator( response = await self.edit_validator(request) await stream.send_message(response) - async def __rpc_delegate(self, stream: "grpclib.server.Stream[MsgDelegate, MsgDelegateResponse]") -> None: + async def __rpc_delegate( + self, stream: "grpclib.server.Stream[MsgDelegate, MsgDelegateResponse]" + ) -> None: request = await stream.recv_message() response = await self.delegate(request) await stream.send_message(response) @@ -1350,11 +1543,28 @@ async def __rpc_begin_redelegate( response = await self.begin_redelegate(request) await stream.send_message(response) - async def __rpc_undelegate(self, stream: "grpclib.server.Stream[MsgUndelegate, MsgUndelegateResponse]") -> None: + async def __rpc_undelegate( + self, stream: "grpclib.server.Stream[MsgUndelegate, MsgUndelegateResponse]" + ) -> None: request = await stream.recv_message() 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( @@ -1387,14 +1597,31 @@ 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": + + async def validators( + self, query_validators_request: "QueryValidatorsRequest" + ) -> "QueryValidatorsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def validator(self, query_validator_request: "QueryValidatorRequest") -> "QueryValidatorResponse": + async def validator( + self, query_validator_request: "QueryValidatorRequest" + ) -> "QueryValidatorResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def validator_delegations( @@ -1408,7 +1635,9 @@ async def validator_unbonding_delegations( ) -> "QueryValidatorUnbondingDelegationsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def delegation(self, query_delegation_request: "QueryDelegationRequest") -> "QueryDelegationResponse": + async def delegation( + self, query_delegation_request: "QueryDelegationRequest" + ) -> "QueryDelegationResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def unbonding_delegation( @@ -1450,7 +1679,9 @@ async def historical_info( async def pool(self, query_pool_request: "QueryPoolRequest") -> "QueryPoolResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def params(self, query_params_request: "QueryParamsRequest") -> "QueryParamsResponse": + async def params( + self, query_params_request: "QueryParamsRequest" + ) -> "QueryParamsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def __rpc_validators( @@ -1549,12 +1780,16 @@ async def __rpc_historical_info( response = await self.historical_info(request) await stream.send_message(response) - async def __rpc_pool(self, stream: "grpclib.server.Stream[QueryPoolRequest, QueryPoolResponse]") -> None: + async def __rpc_pool( + self, stream: "grpclib.server.Stream[QueryPoolRequest, QueryPoolResponse]" + ) -> None: request = await stream.recv_message() response = await self.pool(request) await stream.send_message(response) - async def __rpc_params(self, stream: "grpclib.server.Stream[QueryParamsRequest, QueryParamsResponse]") -> None: + 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) diff --git a/pyband/proto/cosmos/store/__init__.py b/pyband/proto/cosmos/store/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/store/internal/__init__.py b/pyband/proto/cosmos/store/internal/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/store/internal/kv/__init__.py b/pyband/proto/cosmos/store/internal/kv/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/base/kv/v1beta1/__init__.py b/pyband/proto/cosmos/store/internal/kv/v1beta1/__init__.py similarity index 86% rename from pyband/proto/cosmos/base/kv/v1beta1/__init__.py rename to pyband/proto/cosmos/store/internal/kv/v1beta1/__init__.py index d5fbeeb..3ee4a31 100644 --- a/pyband/proto/cosmos/base/kv/v1beta1/__init__.py +++ b/pyband/proto/cosmos/store/internal/kv/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/base/kv/v1beta1/kv.proto +# sources: cosmos/store/internal/kv/v1beta1/kv.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List diff --git a/pyband/proto/cosmos/store/snapshots/__init__.py b/pyband/proto/cosmos/store/snapshots/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/base/snapshots/v1beta1/__init__.py b/pyband/proto/cosmos/store/snapshots/v1/__init__.py similarity index 80% rename from pyband/proto/cosmos/base/snapshots/v1beta1/__init__.py rename to pyband/proto/cosmos/store/snapshots/v1/__init__.py index 5d109cf..c850668 100644 --- a/pyband/proto/cosmos/base/snapshots/v1beta1/__init__.py +++ b/pyband/proto/cosmos/store/snapshots/v1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/base/snapshots/v1beta1/snapshot.proto +# sources: cosmos/store/snapshots/v1beta1/snapshot.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List @@ -27,24 +29,38 @@ class Metadata(betterproto.Message): @dataclass(eq=False, repr=False) class SnapshotItem(betterproto.Message): - """SnapshotItem is an item contained in a rootmulti.Store snapshot.""" + """ + 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") + 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.""" + """ + 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.""" + """ + SnapshotIAVLItem is an exported IAVL node. + + Since: cosmos-sdk 0.46 + """ key: bytes = betterproto.bytes_field(1) value: bytes = betterproto.bytes_field(2) @@ -59,6 +75,8 @@ class SnapshotIavlItem(betterproto.Message): class SnapshotExtensionMeta(betterproto.Message): """ SnapshotExtensionMeta contains metadata about an external snapshotter. + + Since: cosmos-sdk 0.46 """ name: str = betterproto.string_field(1) @@ -69,6 +87,8 @@ class SnapshotExtensionMeta(betterproto.Message): 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/pyband/proto/cosmos/store/streaming/__init__.py b/pyband/proto/cosmos/store/streaming/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/store/streaming/abci/__init__.py b/pyband/proto/cosmos/store/streaming/abci/__init__.py new file mode 100644 index 0000000..33d10f7 --- /dev/null +++ b/pyband/proto/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 +# This file has been @generated + +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/pyband/proto/cosmos/base/store/v1beta1/__init__.py b/pyband/proto/cosmos/store/v1beta1/__init__.py similarity index 50% rename from pyband/proto/cosmos/base/store/v1beta1/__init__.py rename to pyband/proto/cosmos/store/v1beta1/__init__.py index 588306b..21b5b50 100644 --- a/pyband/proto/cosmos/base/store/v1beta1/__init__.py +++ b/pyband/proto/cosmos/store/v1beta1/__init__.py @@ -1,28 +1,66 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: cosmos/base/store/v1beta1/commit_info.proto, cosmos/base/store/v1beta1/listening.proto +# sources: cosmos/store/v1beta1/commit_info.proto, cosmos/store/v1beta1/listening.proto # plugin: python-betterproto +# This file has been @generated + 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. + 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. + StoreInfo defines store-specific commit information. It contains a reference + between a store name and the commit ID. """ name: str = betterproto.string_field(1) @@ -32,24 +70,9 @@ class StoreInfo(betterproto.Message): @dataclass(eq=False, repr=False) class CommitId(betterproto.Message): """ - CommitID defines the committment information when a specific store is - committed. + CommitID defines the commitment information when a specific store is + committed. """ version: int = betterproto.int64_field(1) hash: bytes = betterproto.bytes_field(2) - - -@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) diff --git a/pyband/proto/cosmos/tx/config/__init__.py b/pyband/proto/cosmos/tx/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/tx/config/v1/__init__.py b/pyband/proto/cosmos/tx/config/v1/__init__.py new file mode 100644 index 0000000..3edbe3d --- /dev/null +++ b/pyband/proto/cosmos/tx/config/v1/__init__.py @@ -0,0 +1,25 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/tx/config/v1beta1/config.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/tx/signing/v1beta1/__init__.py b/pyband/proto/cosmos/tx/signing/v1beta1/__init__.py index 60b01b5..43dd64b 100644 --- a/pyband/proto/cosmos/tx/signing/v1beta1/__init__.py +++ b/pyband/proto/cosmos/tx/signing/v1beta1/__init__.py @@ -1,52 +1,77 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/tx/signing/v1beta1/signing.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List import betterproto import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf -from ....crypto.multisig import v1beta1 as ___crypto_multisig_v1_beta1__ +from ....crypto.multisig import v1beta1 as __crypto_multisig_v1_beta1__ 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 + UNSPECIFIED = 0 """ SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - rejected + rejected. """ - SIGN_MODE_DIRECT = 1 + 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. + """ + + 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. + + Since: cosmos-sdk 0.50 """ - SIGN_MODE_TEXTUAL = 2 + DIRECT_AUX = 3 """ - 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_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 + 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 + EIP_191 = 191 """ SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 Currently, - SIGN_MODE_EIP_191 is registered as a SignMode enum variant, but is not - implemented on the SDK by default. To enable EIP-191, you need to pass a - custom `TxConfig` that has an implementation of `SignModeHandler` for - EIP-191. The SDK may decide to fully support EIP-191 in the future. Since: - cosmos-sdk 0.45.2 + SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 + + Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + but is not implemented on the SDK by default. To enable EIP-191, you need + to pass a custom `TxConfig` that has an implementation of + `SignModeHandler` for EIP-191. The SDK may decide to fully support + EIP-191 in the future. + + Since: cosmos-sdk 0.45.2 """ @@ -61,10 +86,10 @@ class SignatureDescriptors(betterproto.Message): @dataclass(eq=False, repr=False) class SignatureDescriptor(betterproto.Message): """ - SignatureDescriptor is a convenience type which represents the full data - for a signature including the public key of the signer, signing modes and - the signature itself. It is primarily used for coordinating signatures - between clients. + SignatureDescriptor is a convenience type which represents the full data for + a signature including the public key of the signer, signing modes and the + signature itself. It is primarily used for coordinating signatures between + clients. """ public_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) @@ -73,9 +98,9 @@ class SignatureDescriptor(betterproto.Message): data: "SignatureDescriptorData" = betterproto.message_field(2) sequence: int = betterproto.uint64_field(3) """ - sequence is the sequence of the account, which describes the number of - committed transactions signed by a given address. It is used to prevent - replay attacks. + sequence is the sequence of the account, which describes the + number of committed transactions signed by a given address. It is used to prevent + replay attacks. """ @@ -105,7 +130,9 @@ class SignatureDescriptorDataSingle(betterproto.Message): class SignatureDescriptorDataMulti(betterproto.Message): """Multi is the signature data for a multisig public key""" - bitarray: "___crypto_multisig_v1_beta1__.CompactBitArray" = betterproto.message_field(1) + bitarray: "__crypto_multisig_v1_beta1__.CompactBitArray" = ( + betterproto.message_field(1) + ) """bitarray specifies which keys within the multisig are signing""" signatures: List["SignatureDescriptorData"] = betterproto.message_field(2) diff --git a/pyband/proto/cosmos/tx/v1beta1/__init__.py b/pyband/proto/cosmos/tx/v1beta1/__init__.py index 45711fe..3497549 100644 --- a/pyband/proto/cosmos/tx/v1beta1/__init__.py +++ b/pyband/proto/cosmos/tx/v1beta1/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/tx/v1beta1/service.proto, cosmos/tx/v1beta1/tx.proto # plugin: python-betterproto +# This file has been @generated import warnings from dataclasses import dataclass from typing import ( @@ -15,7 +16,7 @@ import grpclib from betterproto.grpc.grpclib_server import ServiceBase -from ....tendermint import types as ___tendermint_types__ +from ....tendermint import types as __tendermint_types__ from ...base import v1beta1 as __base_v1_beta1__ from ...base.abci import v1beta1 as __base_abci_v1_beta1__ from ...base.query import v1beta1 as __base_query_v1_beta1__ @@ -32,44 +33,44 @@ class OrderBy(betterproto.Enum): """OrderBy defines the sorting order""" - ORDER_BY_UNSPECIFIED = 0 + UNSPECIFIED = 0 """ ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults - to ASC in this case. + to ASC in this case. """ - ORDER_BY_ASC = 1 + ASC = 1 """ORDER_BY_ASC defines ascending order""" - ORDER_BY_DESC = 2 + DESC = 2 """ORDER_BY_DESC defines descending order""" class BroadcastMode(betterproto.Enum): """ BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC - method. + method. """ - BROADCAST_MODE_UNSPECIFIED = 0 + UNSPECIFIED = 0 """zero-value for mode ordering""" - BROADCAST_MODE_BLOCK = 1 + 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 + SYNC = 2 """ BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits - for a CheckTx execution response only. + for a CheckTx execution response only. """ - BROADCAST_MODE_ASYNC = 3 + ASYNC = 3 """ BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client - returns immediately. + returns immediately. """ @@ -83,14 +84,14 @@ class Tx(betterproto.Message): auth_info: "AuthInfo" = betterproto.message_field(2) """ auth_info is the authorization related content of the transaction, - specifically signers, signer modes and fee + specifically signers, signer modes and fee """ signatures: List[bytes] = betterproto.bytes_field(3) """ signatures is a list of signatures that matches the length and order of - AuthInfo's signer_infos to allow connecting signature meta information like - public key and signing mode by position. + AuthInfo's signer_infos to allow connecting signature meta information like + public key and signing mode by position. """ @@ -98,29 +99,29 @@ class Tx(betterproto.Message): class TxRaw(betterproto.Message): """ TxRaw is a variant of Tx that pins the signer's exact binary representation - of body and auth_info. This is used for signing, broadcasting and - verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and - the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used - as the transaction ID. + of body and auth_info. This is used for signing, broadcasting and + verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and + the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used + as the transaction ID. """ body_bytes: bytes = betterproto.bytes_field(1) """ body_bytes is a protobuf serialization of a TxBody that matches the - representation in SignDoc. + representation in SignDoc. """ auth_info_bytes: bytes = betterproto.bytes_field(2) """ auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - representation in SignDoc. + representation in SignDoc. """ signatures: List[bytes] = betterproto.bytes_field(3) """ signatures is a list of signatures that matches the length and order of - AuthInfo's signer_infos to allow connecting signature meta information like - public key and signing mode by position. + AuthInfo's signer_infos to allow connecting signature meta information like + public key and signing mode by position. """ @@ -133,26 +134,66 @@ class SignDoc(betterproto.Message): body_bytes: bytes = betterproto.bytes_field(1) """ body_bytes is protobuf serialization of a TxBody that matches the - representation in TxRaw. + representation in TxRaw. """ auth_info_bytes: bytes = betterproto.bytes_field(2) """ auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - representation in TxRaw. + representation in TxRaw. """ chain_id: str = betterproto.string_field(3) """ - chain_id is the unique identifier of the chain this transaction targets. It - prevents signed transactions from being used on another chain by an - attacker + chain_id is the unique 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""" +@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.""" @@ -160,39 +201,43 @@ class TxBody(betterproto.Message): messages: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(1) """ messages is a list of messages to be executed. The required signers of - those messages define the number and order of elements in AuthInfo's - signer_infos and Tx's signatures. Each required signer address is added to - the list only the first time it occurs. By convention, the first required - signer (usually from the first message) is referred to as the primary - signer and pays the fee for the whole transaction. + those messages define the number and order of elements in AuthInfo's + signer_infos and Tx's signatures. Each required signer address is added to + the list only the first time it occurs. + By convention, the first required signer (usually from the first message) + is referred to as the primary signer and pays the fee for the whole + transaction. """ memo: str = betterproto.string_field(2) """ - memo is any arbitrary note/comment to be added to the transaction. WARNING: - in clients, any publicly exposed text should not be called memo, but should - be called `note` instead (see https://github.com/cosmos/cosmos- - sdk/issues/9122). + memo is any arbitrary note/comment to be added to the transaction. + WARNING: in clients, any publicly exposed text should not be called memo, + but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). """ timeout_height: int = betterproto.uint64_field(3) """ - timeout is the block height after which this transaction will not be - processed by the chain + timeout is the block height after which this transaction will not + be 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 + 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 - can't be handled, they will be ignored + 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, they will be ignored """ @@ -200,51 +245,66 @@ class TxBody(betterproto.Message): class AuthInfo(betterproto.Message): """ AuthInfo describes the fee and signer modes that are used to sign a - transaction. + transaction. """ signer_infos: List["SignerInfo"] = betterproto.message_field(1) """ signer_infos defines the signing modes for the required signers. The number - and order of elements must match the required signers from TxBody's - messages. The first element is the primary signer and the one which pays - the fee. + and order of elements must match the required signers from TxBody's + messages. The first element is the primary signer and the one which pays + the fee. """ fee: "Fee" = betterproto.message_field(2) """ Fee is the fee and gas limit for the transaction. The first signer is the - primary signer and the one which pays the fee. The fee can be calculated - based on the cost of evaluating the body and doing signature verification - of the signers. This can be estimated via simulation. + primary signer and the one which pays the fee. The fee can be calculated + based on the cost of evaluating the body and doing signature verification + 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): """ SignerInfo describes the public key and signing mode of a single top-level - signer. + signer. """ public_key: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(1) """ public_key is the public key of the signer. It is optional for accounts - that already exist in state. If unset, the verifier can use the required \ - signer address for this position and lookup the public key. + that already exist in state. If unset, the verifier can use the required \ + signer address for this position and lookup the public key. """ mode_info: "ModeInfo" = betterproto.message_field(2) """ mode_info describes the signing mode of the signer and is a nested - structure to support nested multisig pubkey's + structure to support nested multisig pubkey's """ sequence: int = betterproto.uint64_field(3) """ - sequence is the sequence of the account, which describes the number of - committed transactions signed by a given address. It is used to prevent - replay attacks. + sequence is the sequence of the account, which describes the + number of committed transactions signed by a given address. It is used to + prevent replay attacks. """ @@ -265,8 +325,8 @@ class ModeInfo(betterproto.Message): class ModeInfoSingle(betterproto.Message): """ Single is the mode info for a single signer. It is structured as a message - to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - future + to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + future """ mode: "_signing_v1_beta1__.SignMode" = betterproto.enum_field(1) @@ -277,22 +337,24 @@ class ModeInfoSingle(betterproto.Message): class ModeInfoMulti(betterproto.Message): """Multi is the mode info for a multisig public key""" - bitarray: "__crypto_multisig_v1_beta1__.CompactBitArray" = betterproto.message_field(1) + bitarray: "__crypto_multisig_v1_beta1__.CompactBitArray" = ( + betterproto.message_field(1) + ) """bitarray specifies which keys within the multisig are signing""" mode_infos: List["ModeInfo"] = betterproto.message_field(2) """ - mode_infos is the corresponding modes of the signers of the multisig which - could include nested multisig public keys + mode_infos is the corresponding modes of the signers of the multisig + which could include nested multisig public keys """ @dataclass(eq=False, repr=False) class Fee(betterproto.Message): """ - Fee includes the amount of coins paid in fees and the maximum gas to be - used by the transaction. The ratio yields an effective "gasprice", which - must be above some miminum to be accepted into the mempool. + Fee includes the amount of coins paid in fees and the maximum + gas to be used by the transaction. The ratio yields an effective "gasprice", + which must be above some miminum to be accepted into the mempool. """ amount: List["__base_v1_beta1__.Coin"] = betterproto.message_field(1) @@ -301,64 +363,163 @@ class Fee(betterproto.Message): gas_limit: int = betterproto.uint64_field(2) """ gas_limit is the maximum gas that can be used in transaction processing - before an out of gas error occurs + before an out of gas error occurs """ payer: str = betterproto.string_field(3) """ - if unset, the first signer is responsible for paying the fees. If set, the - specified account must pay the fees. the payer must be a tx signer (and - thus have signed this field in AuthInfo). setting this field does *not* - change the ordering of required signers for the transaction. + if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + the payer must be a tx signer (and thus have signed this field in AuthInfo). + setting this field does *not* change the ordering of required signers for the transaction. """ granter: str = betterproto.string_field(4) """ - if set, the fee payer (either the first signer or the value of the payer - field) requests that a fee grant be used to pay fees instead of the fee - payer's own balance. If an appropriate fee grant does not exist or the - chain does not support fee grants, this will fail + if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + not support fee grants, this will fail """ +@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): """ - GetTxsEventRequest is the request type for the Service.TxsByEvents RPC - method. + GetTxsEventRequest is the request type for the Service.TxsByEvents + RPC method. """ 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) class GetTxsEventResponse(betterproto.Message): """ - GetTxsEventResponse is the response type for the Service.TxsByEvents RPC - method. + GetTxsEventResponse is the response type for the Service.TxsByEvents + RPC method. """ txs: List["Tx"] = betterproto.message_field(1) """txs is the list of queried transactions.""" - tx_responses: List["__base_abci_v1_beta1__.TxResponse"] = betterproto.message_field(2) + tx_responses: List["__base_abci_v1_beta1__.TxResponse"] = betterproto.message_field( + 2 + ) """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) class BroadcastTxRequest(betterproto.Message): """ BroadcastTxRequest is the request type for the Service.BroadcastTxRequest - RPC method. + RPC method. """ tx_bytes: bytes = betterproto.bytes_field(1) @@ -370,8 +531,8 @@ class BroadcastTxRequest(betterproto.Message): @dataclass(eq=False, repr=False) class BroadcastTxResponse(betterproto.Message): """ - BroadcastTxResponse is the response type for the Service.BroadcastTx - method. + BroadcastTxResponse is the response type for the + Service.BroadcastTx method. """ tx_response: "__base_abci_v1_beta1__.TxResponse" = betterproto.message_field(1) @@ -381,16 +542,22 @@ class BroadcastTxResponse(betterproto.Message): @dataclass(eq=False, repr=False) class SimulateRequest(betterproto.Message): """ - SimulateRequest is the request type for the Service.Simulate RPC method. + SimulateRequest is the request type for the Service.Simulate + RPC method. """ tx: "Tx" = betterproto.message_field(1) """ - tx is the transaction to simulate. Deprecated. Send raw tx bytes instead. + tx is the transaction to simulate. + Deprecated. Send raw tx bytes instead. """ tx_bytes: bytes = betterproto.bytes_field(2) - """tx_bytes is the raw transaction. Since: cosmos-sdk 0.43""" + """ + tx_bytes is the raw transaction. + + Since: cosmos-sdk 0.43 + """ def __post_init__(self) -> None: super().__post_init__() @@ -401,7 +568,8 @@ def __post_init__(self) -> None: @dataclass(eq=False, repr=False) class SimulateResponse(betterproto.Message): """ - SimulateResponse is the response type for the Service.SimulateRPC method. + SimulateResponse is the response type for the + Service.SimulateRPC method. """ gas_info: "__base_abci_v1_beta1__.GasInfo" = betterproto.message_field(1) @@ -413,7 +581,10 @@ class SimulateResponse(betterproto.Message): @dataclass(eq=False, repr=False) class GetTxRequest(betterproto.Message): - """GetTxRequest is the request type for the Service.GetTx RPC method.""" + """ + GetTxRequest is the request type for the Service.GetTx + RPC method. + """ hash: str = betterproto.string_field(1) """hash is the tx hash to query, encoded as a hex string.""" @@ -434,7 +605,9 @@ class GetTxResponse(betterproto.Message): class GetBlockWithTxsRequest(betterproto.Message): """ GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs - RPC method. Since: cosmos-sdk 0.45.2 + RPC method. + + Since: cosmos-sdk 0.45.2 """ height: int = betterproto.int64_field(1) @@ -447,19 +620,121 @@ class GetBlockWithTxsRequest(betterproto.Message): @dataclass(eq=False, repr=False) class GetBlockWithTxsResponse(betterproto.Message): """ - GetBlockWithTxsResponse is the response type for the - Service.GetBlockWithTxs method. Since: cosmos-sdk 0.45.2 + GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + method. + + Since: cosmos-sdk 0.45.2 """ txs: List["Tx"] = betterproto.message_field(1) """txs are the transactions in the block.""" - block_id: "___tendermint_types__.BlockId" = betterproto.message_field(2) - block: "___tendermint_types__.Block" = betterproto.message_field(3) + block_id: "__tendermint_types__.BlockId" = betterproto.message_field(2) + block: "__tendermint_types__.Block" = betterproto.message_field(3) pagination: "__base_query_v1_beta1__.PageResponse" = betterproto.message_field(4) """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, @@ -546,6 +821,74 @@ 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": @@ -554,10 +897,14 @@ async def simulate(self, simulate_request: "SimulateRequest") -> "SimulateRespon async def get_tx(self, get_tx_request: "GetTxRequest") -> "GetTxResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def broadcast_tx(self, broadcast_tx_request: "BroadcastTxRequest") -> "BroadcastTxResponse": + async def broadcast_tx( + self, broadcast_tx_request: "BroadcastTxRequest" + ) -> "BroadcastTxResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def get_txs_event(self, get_txs_event_request: "GetTxsEventRequest") -> "GetTxsEventResponse": + async def get_txs_event( + self, get_txs_event_request: "GetTxsEventRequest" + ) -> "GetTxsEventResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def get_block_with_txs( @@ -565,12 +912,36 @@ async def get_block_with_txs( ) -> "GetBlockWithTxsResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_simulate(self, stream: "grpclib.server.Stream[SimulateRequest, SimulateResponse]") -> None: + 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: request = await stream.recv_message() response = await self.simulate(request) await stream.send_message(response) - async def __rpc_get_tx(self, stream: "grpclib.server.Stream[GetTxRequest, GetTxResponse]") -> None: + async def __rpc_get_tx( + self, stream: "grpclib.server.Stream[GetTxRequest, GetTxResponse]" + ) -> None: request = await stream.recv_message() response = await self.get_tx(request) await stream.send_message(response) @@ -597,6 +968,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( @@ -629,4 +1030,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/pyband/proto/cosmos/upgrade/module/__init__.py b/pyband/proto/cosmos/upgrade/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/upgrade/module/v1/__init__.py b/pyband/proto/cosmos/upgrade/module/v1/__init__.py new file mode 100644 index 0000000..97a1dff --- /dev/null +++ b/pyband/proto/cosmos/upgrade/module/v1/__init__.py @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/upgrade/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/upgrade/v1beta1/__init__.py b/pyband/proto/cosmos/upgrade/v1beta1/__init__.py index a89a00a..34d3f78 100644 --- a/pyband/proto/cosmos/upgrade/v1beta1/__init__.py +++ b/pyband/proto/cosmos/upgrade/v1beta1/__init__.py @@ -1,6 +1,7 @@ # 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 +# This file has been @generated import warnings from dataclasses import dataclass from datetime import datetime @@ -26,45 +27,43 @@ @dataclass(eq=False, repr=False) class Plan(betterproto.Message): """ - Plan specifies information about a planned upgrade and when it should - occur. + Plan specifies information about a planned upgrade and when it should occur. """ name: str = betterproto.string_field(1) """ Sets the name for the upgrade. This name will be used by the upgraded - version of the software to apply any special "on-upgrade" commands during - the first BeginBlock method after the upgrade is applied. It is also used - to detect whether a software version can handle a given upgrade. If no - upgrade handler with this name has been set in the software, it will be - assumed that the software is out-of-date when the upgrade Time or Height is - reached and the software will exit. + version of the software to apply any special "on-upgrade" commands during + the first BeginBlock method after the upgrade is applied. It is also used + to detect whether a software version can handle a given upgrade. If no + upgrade handler with this name has been set in the software, it will be + assumed that the software is out-of-date when the upgrade Time or Height is + reached and the software will exit. """ time: datetime = betterproto.message_field(2) """ - Deprecated: Time based upgrades have been deprecated. Time based upgrade - logic has been removed from the SDK. If this field is not empty, an error - will be thrown. + Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + has been removed from the SDK. + If this field is not empty, an error will be thrown. """ 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) """ - Any application specific upgrade info to be included on-chain such as a git - commit that validators could automatically upgrade to + Any application specific upgrade info to be included on-chain + such as a git commit that validators could automatically upgrade to """ - upgraded_client_state: "betterproto_lib_google_protobuf.Any" = betterproto.message_field(5) + upgraded_client_state: "betterproto_lib_google_protobuf.Any" = ( + betterproto.message_field(5) + ) """ - Deprecated: UpgradedClientState field has been deprecated. IBC upgrade - logic has been moved to the IBC module in the sub module 02-client. If this - field is not empty, an error will be thrown. + Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + moved to the IBC module in the sub module 02-client. + If this field is not empty, an error will be thrown. """ def __post_init__(self) -> None: @@ -72,37 +71,60 @@ def __post_init__(self) -> None: if self.is_set("time"): warnings.warn("Plan.time is deprecated", DeprecationWarning) if self.is_set("upgraded_client_state"): - warnings.warn("Plan.upgraded_client_state is deprecated", DeprecationWarning) + warnings.warn( + "Plan.upgraded_client_state is deprecated", DeprecationWarning + ) @dataclass(eq=False, repr=False) 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. + CancelSoftwareUpgradeProposal is a gov Content type for cancelling a 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) class ModuleVersion(betterproto.Message): """ - ModuleVersion specifies a module and its consensus version. Since: cosmos- - sdk 0.43 + ModuleVersion specifies a module and its consensus version. + + Since: cosmos-sdk 0.43 """ name: str = betterproto.string_field(1) @@ -112,11 +134,64 @@ 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): """ QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC - method. + method. """ pass @@ -126,7 +201,7 @@ class QueryCurrentPlanRequest(betterproto.Message): class QueryCurrentPlanResponse(betterproto.Message): """ QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC - method. + method. """ plan: "Plan" = betterproto.message_field(1) @@ -137,7 +212,7 @@ class QueryCurrentPlanResponse(betterproto.Message): class QueryAppliedPlanRequest(betterproto.Message): """ QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC - method. + method. """ name: str = betterproto.string_field(1) @@ -148,7 +223,7 @@ class QueryAppliedPlanRequest(betterproto.Message): class QueryAppliedPlanResponse(betterproto.Message): """ QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC - method. + method. """ height: int = betterproto.int64_field(1) @@ -158,33 +233,37 @@ class QueryAppliedPlanResponse(betterproto.Message): @dataclass(eq=False, repr=False) class QueryUpgradedConsensusStateRequest(betterproto.Message): """ - QueryUpgradedConsensusStateRequest is the request type for the - Query/UpgradedConsensusState RPC method. + QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState + RPC method. """ last_height: int = betterproto.int64_field(1) """ - last height of the current chain must be sent in request as this is the - height under which next consensus state is stored + last height of the current chain must be sent in request + as this is the height under which next consensus state is stored """ def __post_init__(self) -> None: - warnings.warn("QueryUpgradedConsensusStateRequest is deprecated", DeprecationWarning) + warnings.warn( + "QueryUpgradedConsensusStateRequest is deprecated", DeprecationWarning + ) super().__post_init__() @dataclass(eq=False, repr=False) class QueryUpgradedConsensusStateResponse(betterproto.Message): """ - QueryUpgradedConsensusStateResponse is the response type for the - Query/UpgradedConsensusState RPC method. + QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState + RPC method. """ upgraded_consensus_state: bytes = betterproto.bytes_field(2) """Since: cosmos-sdk 0.43""" def __post_init__(self) -> None: - warnings.warn("QueryUpgradedConsensusStateResponse is deprecated", DeprecationWarning) + warnings.warn( + "QueryUpgradedConsensusStateResponse is deprecated", DeprecationWarning + ) super().__post_init__() @@ -192,22 +271,26 @@ def __post_init__(self) -> None: class QueryModuleVersionsRequest(betterproto.Message): """ QueryModuleVersionsRequest is the request type for the Query/ModuleVersions - RPC method. Since: cosmos-sdk 0.43 + RPC method. + + Since: cosmos-sdk 0.43 """ module_name: str = betterproto.string_field(1) """ - module_name is a field to query a specific module consensus version from - state. Leaving this empty will fetch the full list of module versions from - state + module_name is a field to query a specific module + consensus version from state. Leaving this empty will + fetch the full list of module versions from state """ @dataclass(eq=False, repr=False) class QueryModuleVersionsResponse(betterproto.Message): """ - QueryModuleVersionsResponse is the response type for the - Query/ModuleVersions RPC method. Since: cosmos-sdk 0.43 + QueryModuleVersionsResponse is the response type for the Query/ModuleVersions + RPC method. + + Since: cosmos-sdk 0.43 """ module_versions: List["ModuleVersion"] = betterproto.message_field(1) @@ -216,6 +299,64 @@ 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, @@ -259,6 +400,10 @@ async def upgraded_consensus_state( deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None ) -> "QueryUpgradedConsensusStateResponse": + warnings.warn( + "Query.upgraded_consensus_state is deprecated", DeprecationWarning + ) + return await self._unary_unary( "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState", query_upgraded_consensus_state_request, @@ -285,12 +430,79 @@ 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": + + async def current_plan( + self, query_current_plan_request: "QueryCurrentPlanRequest" + ) -> "QueryCurrentPlanResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def applied_plan(self, query_applied_plan_request: "QueryAppliedPlanRequest") -> "QueryAppliedPlanResponse": + async def applied_plan( + self, query_applied_plan_request: "QueryAppliedPlanRequest" + ) -> "QueryAppliedPlanResponse": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def upgraded_consensus_state( @@ -304,6 +516,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]", @@ -336,6 +553,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( @@ -362,4 +587,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/pyband/proto/cosmos/vesting/module/__init__.py b/pyband/proto/cosmos/vesting/module/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyband/proto/cosmos/vesting/module/v1/__init__.py b/pyband/proto/cosmos/vesting/module/v1/__init__.py new file mode 100644 index 0000000..2f8fc67 --- /dev/null +++ b/pyband/proto/cosmos/vesting/module/v1/__init__.py @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# sources: cosmos/vesting/module/v1beta1/module.proto +# plugin: python-betterproto +# This file has been @generated + +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/pyband/proto/cosmos/vesting/v1beta1/__init__.py b/pyband/proto/cosmos/vesting/v1beta1/__init__.py index 938141a..354289d 100644 --- a/pyband/proto/cosmos/vesting/v1beta1/__init__.py +++ b/pyband/proto/cosmos/vesting/v1beta1/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos/vesting/v1beta1/tx.proto, cosmos/vesting/v1beta1/vesting.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import ( TYPE_CHECKING, @@ -23,35 +25,11 @@ 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): """ BaseVestingAccount implements the VestingAccount interface. It contains all - the necessary fields needed for any vesting account implementation. + the necessary fields needed for any vesting account implementation. """ base_account: "__auth_v1_beta1__.BaseAccount" = betterproto.message_field(1) @@ -59,25 +37,27 @@ 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) class ContinuousVestingAccount(betterproto.Message): """ ContinuousVestingAccount implements the VestingAccount interface. It - continuously vests by unlocking coins linearly with respect to time. + continuously vests by unlocking coins linearly with respect to time. """ 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) class DelayedVestingAccount(betterproto.Message): """ DelayedVestingAccount implements the VestingAccount interface. It vests all - coins after a specific time, but non prior. In other words, it keeps them - locked until a specified time. + coins after a specific time, but non prior. In other words, it keeps them + locked until a specified time. """ base_vesting_account: "BaseVestingAccount" = betterproto.message_field(1) @@ -88,6 +68,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) @@ -95,7 +77,7 @@ class Period(betterproto.Message): class PeriodicVestingAccount(betterproto.Message): """ PeriodicVestingAccount implements the VestingAccount interface. It - periodically vests by unlocking coins during each specified period. + periodically vests by unlocking coins during each specified period. """ base_vesting_account: "BaseVestingAccount" = betterproto.message_field(1) @@ -106,15 +88,95 @@ class PeriodicVestingAccount(betterproto.Message): @dataclass(eq=False, repr=False) class PermanentLockedAccount(betterproto.Message): """ - PermanentLockedAccount implements the VestingAccount interface. It does not - ever release coins, locking them indefinitely. Coins in this account can - still be used for delegating and for governance votes even while locked. - Since: cosmos-sdk 0.43 + PermanentLockedAccount implements the VestingAccount interface. It does + not ever release coins, locking them indefinitely. Coins in this account can + still be used for delegating and for governance votes even while locked. + + Since: cosmos-sdk 0.43 """ 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 +195,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 +255,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 +279,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/pyband/proto/cosmos_proto/__init__.py b/pyband/proto/cosmos_proto/__init__.py index bc87e08..68d009d 100644 --- a/pyband/proto/cosmos_proto/__init__.py +++ b/pyband/proto/cosmos_proto/__init__.py @@ -1,6 +1,73 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: cosmos_proto/cosmos.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass +from typing import List import betterproto + + +class ScalarType(betterproto.Enum): + UNSPECIFIED = 0 + STRING = 1 + 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/pyband/proto/gogoproto/__init__.py b/pyband/proto/gogoproto/__init__.py index 1d57db1..76f4d02 100644 --- a/pyband/proto/gogoproto/__init__.py +++ b/pyband/proto/gogoproto/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: gogoproto/gogo.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto diff --git a/pyband/proto/google/api/__init__.py b/pyband/proto/google/api/__init__.py index e3b201c..522615d 100644 --- a/pyband/proto/google/api/__init__.py +++ b/pyband/proto/google/api/__init__.py @@ -1,199 +1,370 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: google/api/annotations.proto, google/api/http.proto, google/api/httpbody.proto +# sources: google/api/annotations.proto, google/api/http.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List import betterproto -import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf @dataclass(eq=False, repr=False) class Http(betterproto.Message): """ Defines the HTTP configuration for an API service. It contains a list of - [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC - method to one or more HTTP REST API methods. + [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + to one or more HTTP REST API methods. """ rules: List["HttpRule"] = betterproto.message_field(1) """ A list of HTTP configuration rules that apply to individual API methods. - **NOTE:** All service configuration rules follow "last one wins" order. + + **NOTE:** All service configuration rules follow "last one wins" order. """ fully_decode_reserved_expansion: bool = betterproto.bool_field(2) """ - When set to true, URL path parmeters will be fully URI-decoded except in - cases of single segment matches in reserved expansion, where "%2F" will be - left encoded. The default behavior is to not decode RFC 6570 reserved - characters in multi segment matches. + When set to true, URL path parameters will be fully URI-decoded except in + cases of single segment matches in reserved expansion, where "%2F" will be + left encoded. + + The default behavior is to not decode RFC 6570 reserved characters in multi + segment matches. """ @dataclass(eq=False, repr=False) class HttpRule(betterproto.Message): """ - `HttpRule` defines the mapping of an RPC method to one or more HTTP REST - API methods. The mapping specifies how different portions of the RPC - request message are mapped to URL path, URL query parameters, and HTTP - request body. The mapping is typically specified as an `google.api.http` - annotation on the RPC method, see "google/api/annotations.proto" for - details. The mapping consists of a field specifying the path template and - method kind. The path template can refer to fields in the request message, - as in the example below which describes a REST GET operation on a resource - collection of messages: service Messaging { rpc - GetMessage(GetMessageRequest) returns (Message) { option - (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; } - } message GetMessageRequest { message SubMessage { string - subfield = 1; } string message_id = 1; // mapped to the URL - SubMessage sub = 2; // `sub.subfield` is url-mapped } message - Message { string text = 1; // content of the resource } The same - http annotation can alternatively be expressed inside the `GRPC API - Configuration` YAML file. http: rules: - selector: - .Messaging.GetMessage get: - /v1/messages/{message_id}/{sub.subfield} This definition enables an - automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC - -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: - "123456" sub: SubMessage(subfield: "foo"))` In general, not only fields but - also field paths can be referenced from a path pattern. Fields mapped to - the path pattern cannot be repeated and must have a primitive (non-message) - type. Any fields in the request message which are not bound by the path - pattern automatically become (optional) HTTP query parameters. Assume the - following definition of the request message: service Messaging { - rpc GetMessage(GetMessageRequest) returns (Message) { option - (google.api.http).get = "/v1/messages/{message_id}"; } } - message GetMessageRequest { message SubMessage { string - subfield = 1; } string message_id = 1; // mapped to the URL - int64 revision = 2; // becomes a parameter SubMessage sub = 3; - // `sub.subfield` becomes a parameter } This enables a HTTP JSON to RPC - mapping as below: HTTP | RPC -----|----- `GET - /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: - "123456" revision: 2 sub: SubMessage(subfield: "foo"))` Note that fields - which are mapped to HTTP parameters must have a primitive type or a - repeated primitive type. Message types are not allowed. In the case of a - repeated type, the parameter can be repeated in the URL, as in - `...?param=A¶m=B`. For HTTP method kinds which allow a request body, - the `body` field specifies the mapping. Consider a REST update method on - the message resource collection: service Messaging { rpc - UpdateMessage(UpdateMessageRequest) returns (Message) { option - (google.api.http) = { put: "/v1/messages/{message_id}" - body: "message" }; } } message UpdateMessageRequest { - string message_id = 1; // mapped to the URL Message message = 2; // - mapped to the body } The following HTTP JSON to RPC mapping is enabled, - where the representation of the JSON in the request body is determined by - protos JSON encoding: HTTP | RPC -----|----- `PUT /v1/messages/123456 { - "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: - "Hi!" })` The special name `*` can be used in the body mapping to define - that every field not bound by the path template should be mapped to the - request body. This enables the following alternative definition of the - update method: service Messaging { rpc UpdateMessage(Message) - returns (Message) { option (google.api.http) = { put: - "/v1/messages/{message_id}" body: "*" }; } } - message Message { string message_id = 1; string text = 2; } - The following HTTP JSON to RPC mapping is enabled: HTTP | RPC -----|----- - `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - "123456" text: "Hi!")` Note that when using `*` in the body mapping, it is - not possible to have HTTP parameters, as all fields not bound by the path - end in the body. This makes this option more rarely used in practice of - defining REST APIs. The common usage of `*` is in custom methods which - don't use the URL at all for transferring data. It is possible to define - multiple HTTP methods for one RPC by using the `additional_bindings` - option. Example: service Messaging { rpc - GetMessage(GetMessageRequest) returns (Message) { option - (google.api.http) = { get: "/v1/messages/{message_id}" - additional_bindings { get: - "/v1/users/{user_id}/messages/{message_id}" } }; } - } message GetMessageRequest { string message_id = 1; string - user_id = 2; } This enables the following two alternative HTTP JSON to - RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | - `GetMessage(message_id: "123456")` `GET /v1/users/me/messages/123456` | - `GetMessage(user_id: "me" message_id: "123456")` # Rules for HTTP mapping - The rules for mapping HTTP path, query parameters, and body fields to the - request message are as follows: 1. The `body` field specifies either `*` or - a field path, or is omitted. If omitted, it indicates there is no HTTP - request body. 2. Leaf fields (recursive expansion of nested messages in the - request) can be classified into three types: (a) Matched in the URL - template. (b) Covered by body (if body is `*`, everything except (a) - fields; else everything under the body field) (c) All other - fields. 3. URL query parameters found in the HTTP request are mapped to (c) - fields. 4. Any body sent with an HTTP request can contain only (b) fields. - The syntax of the path template is as follows: Template = "/" Segments - [ Verb ] ; Segments = Segment { "/" Segment } ; Segment = "*" | - "**" | LITERAL | Variable ; Variable = "{" FieldPath [ "=" Segments ] - "}" ; FieldPath = IDENT { "." IDENT } ; Verb = ":" LITERAL ; - The syntax `*` matches a single path segment. The syntax `**` matches zero - or more path segments, which must be the last part of the path except the - `Verb`. The syntax `LITERAL` matches literal text in the path. The syntax - `Variable` matches part of the URL path as specified by its template. A - variable template must not contain other variables. If a variable matches a - single path segment, its template may be omitted, e.g. `{var}` is - equivalent to `{var=*}`. If a variable contains exactly one path segment, - such as `"{var}"` or `"{var=*}"`, when such a variable is expanded into a - URL path, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. Such - variables show up in the Discovery Document as `{var}`. If a variable - contains one or more path segments, such as `"{var=foo/*}"` or - `"{var=**}"`, when such a variable is expanded into a URL path, all - characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables - show up in the Discovery Document as `{+var}`. NOTE: While the single - segment variable matches the semantics of [RFC - 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - Expansion, the multi segment variable **does not** match RFC 6570 Reserved - Expansion. The reason is that the Reserved Expansion does not expand - special characters like `?` and `#`, which would lead to invalid URLs. - NOTE: the field paths in variables and in the `body` must not refer to - repeated fields or map fields. + gRPC Transcoding + + gRPC Transcoding is a feature for mapping between a gRPC method and one or + more HTTP REST endpoints. It allows developers to build a single API service + that supports both gRPC APIs and REST APIs. Many systems, including [Google + APIs](https://github.com/googleapis/googleapis), + [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + and use it for large scale production services. + + `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + how different portions of the gRPC request message are mapped to the URL + path, URL query parameters, and HTTP request body. It also controls how the + gRPC response message is mapped to the HTTP response body. `HttpRule` is + typically specified as an `google.api.http` annotation on the gRPC method. + + Each mapping specifies a URL path template and an HTTP method. The path + template may refer to one or more fields in the gRPC request message, as long + as each field is a non-repeated field with a primitive (non-message) type. + The path template controls how fields of the request message are mapped to + the URL path. + + Example: + + service Messaging { + rpc GetMessage(GetMessageRequest) returns (Message) { + option (google.api.http) = { + get: "/v1beta1/{name=messages/*}" + }; + } + } + message GetMessageRequest { + string name = 1; // Mapped to URL path. + } + message Message { + string text = 1; // The resource content. + } + + This enables an HTTP REST to gRPC mapping as below: + + - HTTP: `GET /v1beta1/messages/123456` + - gRPC: `GetMessage(name: "messages/123456")` + + Any fields in the request message which are not bound by the path template + automatically become HTTP query parameters if there is no HTTP request body. + For example: + + service Messaging { + rpc GetMessage(GetMessageRequest) returns (Message) { + option (google.api.http) = { + get:"/v1beta1/messages/{message_id}" + }; + } + } + message GetMessageRequest { + message SubMessage { + string subfield = 1; + } + string message_id = 1; // Mapped to URL path. + int64 revision = 2; // Mapped to URL query parameter `revision`. + SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + } + + This enables a HTTP JSON to RPC mapping as below: + + - HTTP: `GET /v1beta1/messages/123456?revision=2&sub.subfield=foo` + - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + SubMessage(subfield: "foo"))` + + Note that fields which are mapped to URL query parameters must have a + primitive type or a repeated primitive type or a non-repeated message type. + In the case of a repeated type, the parameter can be repeated in the URL + as `...?param=A¶m=B`. In the case of a message type, each field of the + message is mapped to a separate parameter, such as + `...?foo.a=A&foo.b=B&foo.c=C`. + + For HTTP methods that allow a request body, the `body` field + specifies the mapping. Consider a REST update method on the + message resource collection: + + service Messaging { + rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + option (google.api.http) = { + patch: "/v1beta1/messages/{message_id}" + body: "message" + }; + } + } + message UpdateMessageRequest { + string message_id = 1; // mapped to the URL + Message message = 2; // mapped to the body + } + + The following HTTP JSON to RPC mapping is enabled, where the + representation of the JSON in the request body is determined by + protos JSON encoding: + + - HTTP: `PATCH /v1beta1/messages/123456 { "text": "Hi!" }` + - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + + The special name `*` can be used in the body mapping to define that + every field not bound by the path template should be mapped to the + request body. This enables the following alternative definition of + the update method: + + service Messaging { + rpc UpdateMessage(Message) returns (Message) { + option (google.api.http) = { + patch: "/v1beta1/messages/{message_id}" + body: "*" + }; + } + } + message Message { + string message_id = 1; + string text = 2; + } + + + The following HTTP JSON to RPC mapping is enabled: + + - HTTP: `PATCH /v1beta1/messages/123456 { "text": "Hi!" }` + - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` + + Note that when using `*` in the body mapping, it is not possible to + have HTTP parameters, as all fields not bound by the path end in + the body. This makes this option more rarely used in practice when + defining REST APIs. The common usage of `*` is in custom methods + which don't use the URL at all for transferring data. + + It is possible to define multiple HTTP methods for one RPC by using + the `additional_bindings` option. Example: + + service Messaging { + rpc GetMessage(GetMessageRequest) returns (Message) { + option (google.api.http) = { + get: "/v1beta1/messages/{message_id}" + additional_bindings { + get: "/v1beta1/users/{user_id}/messages/{message_id}" + } + }; + } + } + message GetMessageRequest { + string message_id = 1; + string user_id = 2; + } + + This enables the following two alternative HTTP JSON to RPC mappings: + + - HTTP: `GET /v1beta1/messages/123456` + - gRPC: `GetMessage(message_id: "123456")` + + - HTTP: `GET /v1beta1/users/me/messages/123456` + - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + + Rules for HTTP mapping + + 1. Leaf request fields (recursive expansion nested messages in the request + message) are classified into three categories: + - Fields referred by the path template. They are passed via the URL path. + - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + are passed via the HTTP + request body. + - All other fields are passed via the URL query parameters, and the + parameter name is the field path in the request message. A repeated + field can be represented as multiple query parameters under the same + name. + 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + query parameter, all fields + are passed via URL path and HTTP request body. + 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + request body, all + fields are passed via URL path and URL query parameters. + + Path template syntax + + Template = "/" Segments [ Verb ] ; + Segments = Segment { "/" Segment } ; + Segment = "*" | "**" | LITERAL | Variable ; + Variable = "{" FieldPath [ "=" Segments ] "}" ; + FieldPath = IDENT { "." IDENT } ; + Verb = ":" LITERAL ; + + The syntax `*` matches a single URL path segment. The syntax `**` matches + zero or more URL path segments, which must be the last part of the URL path + except the `Verb`. + + The syntax `Variable` matches part of the URL path as specified by its + template. A variable template must not contain other variables. If a variable + matches a single path segment, its template may be omitted, e.g. `{var}` + is equivalent to `{var=*}`. + + The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + contains any reserved character, such characters should be percent-encoded + before the matching. + + If a variable contains exactly one path segment, such as `"{var}"` or + `"{var=*}"`, when such a variable is expanded into a URL path on the client + side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + server side does the reverse decoding. Such variables show up in the + [Discovery + Document](https://developers.google.com/discovery/v1/reference/apis) as + `{var}`. + + If a variable contains multiple path segments, such as `"{var=foo/*}"` + or `"{var=**}"`, when such a variable is expanded into a URL path on the + client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + The server side does the reverse decoding, except "%2F" and "%2f" are left + unchanged. Such variables show up in the + [Discovery + Document](https://developers.google.com/discovery/v1/reference/apis) as + `{+var}`. + + Using gRPC API Service Configuration + + gRPC API Service Configuration (service config) is a configuration language + for configuring a gRPC service to become a user-facing product. The + service config is simply the YAML representation of the `google.api.Service` + proto message. + + As an alternative to annotating your proto file, you can configure gRPC + transcoding in your service config YAML files. You do this by specifying a + `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + effect as the proto annotation. This can be particularly useful if you + have a proto that is reused in multiple services. Note that any transcoding + specified in the service config will override any matching transcoding + configuration in the proto. + + The following example selects a gRPC method and applies an `HttpRule` to it: + + http: + rules: + - selector: example.v1beta1.Messaging.GetMessage + get: /v1beta1/messages/{message_id}/{sub.subfield} + + Special notes + + When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + proto to JSON conversion must follow the [proto3 + specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + + While the single segment variable follows the semantics of + [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + Expansion, the multi segment variable **does not** follow RFC 6570 Section + 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + does not expand special characters like `?` and `#`, which would lead + to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + for multi segment variables. + + The path variables **must not** refer to any repeated or mapped field, + because client libraries are not capable of handling such variable expansion. + + The path variables **must not** capture the leading "/" character. The reason + is that the most common use case "{var}" does not capture the leading "/" + character. For consistency, all path variables must share the same behavior. + + Repeated message fields must not be mapped to URL query parameters, because + no client library can support such complicated mapping. + + If an API needs to use a JSON array for request or response body, it can map + the request or response body to a repeated field. However, some gRPC + Transcoding implementations may not support this feature. """ selector: str = betterproto.string_field(1) """ - Selects methods to which this rule applies. Refer to - [selector][google.api.DocumentationRule.selector] for syntax details. + Selects a method to which this rule applies. + + Refer to [selector][google.api.DocumentationRule.selector] for syntax + details. """ get: str = betterproto.string_field(2, group="pattern") - """Used for listing and getting information about resources.""" + """ + Maps to HTTP GET. Used for listing and getting information about + resources. + """ put: str = betterproto.string_field(3, group="pattern") - """Used for updating a resource.""" + """Maps to HTTP PUT. Used for replacing a resource.""" post: str = betterproto.string_field(4, group="pattern") - """Used for creating a resource.""" + """ + Maps to HTTP POST. Used for creating a resource or performing an action. + """ delete: str = betterproto.string_field(5, group="pattern") - """Used for deleting a resource.""" + """Maps to HTTP DELETE. Used for deleting a resource.""" patch: str = betterproto.string_field(6, group="pattern") - """Used for updating a resource.""" + """Maps to HTTP PATCH. Used for updating a resource.""" custom: "CustomHttpPattern" = betterproto.message_field(8, group="pattern") """ The custom pattern is used for specifying an HTTP method that is not - included in the `pattern` field, such as HEAD, or "*" to leave the HTTP - method unspecified for this rule. The wild-card rule is useful for services - that provide content to Web (HTML) clients. + included in the `pattern` field, such as HEAD, or "*" to leave the + HTTP method unspecified for this rule. The wild-card rule is useful + for services that provide content to Web (HTML) clients. """ body: str = betterproto.string_field(7) """ - The name of the request field whose value is mapped to the HTTP body, or - `*` for mapping all fields not captured by the path pattern to the HTTP - body. NOTE: the referred field must not be a repeated field and must be - present at the top-level of request message type. + The name of the request field whose value is mapped to the HTTP request + body, or `*` for mapping all request fields not captured by the path + pattern to the HTTP body, or omitted for not having any HTTP request body. + + NOTE: the referred field must be present at the top-level of the request + message type. """ response_body: str = betterproto.string_field(12) """ Optional. The name of the response field whose value is mapped to the HTTP - body of response. Other response fields are ignored. When not set, the - response message will be used as HTTP body of response. + response body. When omitted, the entire response message will be used + as the HTTP response body. + + NOTE: The referred field must be present at the top-level of the response + message type. """ additional_bindings: List["HttpRule"] = betterproto.message_field(11) """ - Additional HTTP bindings for the selector. Nested bindings must not contain - an `additional_bindings` field themselves (that is, the nesting may only be - one level deep). + Additional HTTP bindings for the selector. Nested bindings must + not contain an `additional_bindings` field themselves (that is, + the nesting may only be one level deep). """ @@ -206,41 +377,3 @@ class CustomHttpPattern(betterproto.Message): path: str = betterproto.string_field(2) """The path matched by this custom verb.""" - - -@dataclass(eq=False, repr=False) -class HttpBody(betterproto.Message): - """ - Message that represents an arbitrary HTTP body. It should only be used for - payload formats that can't be represented as JSON, such as raw binary or an - HTML page. This message can be used both in streaming and non-streaming API - methods in the request as well as the response. It can be used as a top- - level request field, which is convenient if one wants to extract parameters - from either the URL or HTTP template into the request fields and also want - access to the raw HTTP body. Example: message GetResourceRequest { - // A unique request id. string request_id = 1; // The raw HTTP - body is bound to this field. google.api.HttpBody http_body = 2; } - service ResourceService { rpc GetResource(GetResourceRequest) returns - (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) - returns (google.protobuf.Empty); } Example with streaming - methods: service CaldavService { rpc GetCalendar(stream - google.api.HttpBody) returns (stream google.api.HttpBody); - rpc UpdateCalendar(stream google.api.HttpBody) returns (stream - google.api.HttpBody); } Use of this type only changes how the request - and response bodies are handled, all other features will continue to work - unchanged. - """ - - content_type: str = betterproto.string_field(1) - """ - The HTTP Content-Type header value specifying the content type of the body. - """ - - data: bytes = betterproto.bytes_field(2) - """The HTTP request/response body as raw binary.""" - - extensions: List["betterproto_lib_google_protobuf.Any"] = betterproto.message_field(3) - """ - Application specific response metadata. Must be set in the first response - for streaming APIs. - """ diff --git a/pyband/proto/ics23/__init__.py b/pyband/proto/ics23/__init__.py deleted file mode 100644 index 5417b26..0000000 --- a/pyband/proto/ics23/__init__.py +++ /dev/null @@ -1,276 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# sources: confio/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/pyband/proto/tendermint/abci/__init__.py b/pyband/proto/tendermint/abci/__init__.py index 31183e4..dce3606 100644 --- a/pyband/proto/tendermint/abci/__init__.py +++ b/pyband/proto/tendermint/abci/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: tendermint/abci/types.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from datetime import datetime from typing import ( @@ -31,7 +33,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,23 +57,58 @@ 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") - offer_snapshot: "RequestOfferSnapshot" = betterproto.message_field(13, group="value") - load_snapshot_chunk: "RequestLoadSnapshotChunk" = betterproto.message_field(14, group="value") - apply_snapshot_chunk: "RequestApplySnapshotChunk" = betterproto.message_field(15, group="value") + list_snapshots: "RequestListSnapshots" = betterproto.message_field( + 12, group="value" + ) + offer_snapshot: "RequestOfferSnapshot" = betterproto.message_field( + 13, group="value" + ) + load_snapshot_chunk: "RequestLoadSnapshotChunk" = betterproto.message_field( + 14, group="value" + ) + 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) @@ -89,21 +126,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) @@ -117,30 +147,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 @@ -179,24 +191,128 @@ 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. + """ + + @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") - offer_snapshot: "ResponseOfferSnapshot" = betterproto.message_field(14, group="value") - load_snapshot_chunk: "ResponseLoadSnapshotChunk" = betterproto.message_field(15, group="value") - apply_snapshot_chunk: "ResponseApplySnapshotChunk" = betterproto.message_field(16, group="value") + list_snapshots: "ResponseListSnapshots" = betterproto.message_field( + 13, group="value" + ) + offer_snapshot: "ResponseOfferSnapshot" = betterproto.message_field( + 14, group="value" + ) + load_snapshot_chunk: "ResponseLoadSnapshotChunk" = betterproto.message_field( + 15, group="value" + ) + 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) @@ -225,20 +341,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) @@ -258,11 +363,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) @@ -275,30 +375,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) @@ -325,41 +403,84 @@ 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 ResponseVerifyVoteExtension(betterproto.Message): + status: "ResponseVerifyVoteExtensionVerifyStatus" = betterproto.enum_field(1) @dataclass(eq=False, repr=False) -class BlockParams(betterproto.Message): - """BlockParams contains limits on the block size.""" +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 + """ - max_gas: int = betterproto.int64_field(2) - """Note: must be greater or equal to -1""" + 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. + """ + + 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) @@ -370,28 +491,45 @@ 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): """ - TxResult contains results of executing the transaction. One usage is - indexing transaction results. + TxResult contains results of executing the transaction. + + One usage is indexing transaction results. """ 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];""" @@ -399,23 +537,38 @@ 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""" @@ -428,8 +581,8 @@ class Evidence(betterproto.Message): total_voting_power: int = betterproto.int64_field(5) """ Total voting power of the validator set in case the ABCI application does - not store historical validators. - https://github.com/tendermint/tendermint/issues/4581 + not store historical validators. + https://github.com/tendermint/tendermint/issues/4581 """ @@ -442,7 +595,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", @@ -452,7 +605,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, @@ -469,7 +622,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, @@ -486,7 +639,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, @@ -494,212 +647,230 @@ async def info( metadata=metadata, ) - async def set_option( + async def check_tx( self, - request_set_option: "RequestSetOption", + request_check_tx: "RequestCheckTx", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseSetOption": + ) -> "ResponseCheckTx": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/SetOption", - request_set_option, - ResponseSetOption, + "/tendermint.abci.ABCI/CheckTx", + request_check_tx, + ResponseCheckTx, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def deliver_tx( + async def query( self, - request_deliver_tx: "RequestDeliverTx", + request_query: "RequestQuery", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseDeliverTx": + ) -> "ResponseQuery": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/DeliverTx", - request_deliver_tx, - ResponseDeliverTx, + "/tendermint.abci.ABCI/Query", + request_query, + ResponseQuery, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def check_tx( + async def commit( self, - request_check_tx: "RequestCheckTx", + request_commit: "RequestCommit", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseCheckTx": + ) -> "ResponseCommit": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/CheckTx", - request_check_tx, - ResponseCheckTx, + "/tendermint.abci.ABCI/Commit", + request_commit, + ResponseCommit, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def query( + async def init_chain( self, - request_query: "RequestQuery", + request_init_chain: "RequestInitChain", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseQuery": + ) -> "ResponseInitChain": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Query", - request_query, - ResponseQuery, + "/tendermint.abci.ABCI/InitChain", + request_init_chain, + ResponseInitChain, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def commit( + async def list_snapshots( self, - request_commit: "RequestCommit", + request_list_snapshots: "RequestListSnapshots", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseCommit": + ) -> "ResponseListSnapshots": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/Commit", - request_commit, - ResponseCommit, + "/tendermint.abci.ABCI/ListSnapshots", + request_list_snapshots, + ResponseListSnapshots, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def init_chain( + async def offer_snapshot( self, - request_init_chain: "RequestInitChain", + request_offer_snapshot: "RequestOfferSnapshot", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseInitChain": + ) -> "ResponseOfferSnapshot": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/InitChain", - request_init_chain, - ResponseInitChain, + "/tendermint.abci.ABCI/OfferSnapshot", + request_offer_snapshot, + ResponseOfferSnapshot, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def begin_block( + async def load_snapshot_chunk( self, - request_begin_block: "RequestBeginBlock", + request_load_snapshot_chunk: "RequestLoadSnapshotChunk", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseBeginBlock": + ) -> "ResponseLoadSnapshotChunk": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/BeginBlock", - request_begin_block, - ResponseBeginBlock, + "/tendermint.abci.ABCI/LoadSnapshotChunk", + request_load_snapshot_chunk, + ResponseLoadSnapshotChunk, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def end_block( + async def apply_snapshot_chunk( self, - request_end_block: "RequestEndBlock", + request_apply_snapshot_chunk: "RequestApplySnapshotChunk", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseEndBlock": + ) -> "ResponseApplySnapshotChunk": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/EndBlock", - request_end_block, - ResponseEndBlock, + "/tendermint.abci.ABCI/ApplySnapshotChunk", + request_apply_snapshot_chunk, + ResponseApplySnapshotChunk, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def list_snapshots( + async def prepare_proposal( self, - request_list_snapshots: "RequestListSnapshots", + request_prepare_proposal: "RequestPrepareProposal", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseListSnapshots": + ) -> "ResponsePrepareProposal": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/ListSnapshots", - request_list_snapshots, - ResponseListSnapshots, + "/tendermint.abci.ABCI/PrepareProposal", + request_prepare_proposal, + ResponsePrepareProposal, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def offer_snapshot( + async def process_proposal( self, - request_offer_snapshot: "RequestOfferSnapshot", + request_process_proposal: "RequestProcessProposal", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseOfferSnapshot": + ) -> "ResponseProcessProposal": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/OfferSnapshot", - request_offer_snapshot, - ResponseOfferSnapshot, + "/tendermint.abci.ABCI/ProcessProposal", + request_process_proposal, + ResponseProcessProposal, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def load_snapshot_chunk( + async def extend_vote( self, - request_load_snapshot_chunk: "RequestLoadSnapshotChunk", + request_extend_vote: "RequestExtendVote", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseLoadSnapshotChunk": + ) -> "ResponseExtendVote": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/LoadSnapshotChunk", - request_load_snapshot_chunk, - ResponseLoadSnapshotChunk, + "/tendermint.abci.ABCI/ExtendVote", + request_extend_vote, + ResponseExtendVote, timeout=timeout, deadline=deadline, metadata=metadata, ) - async def apply_snapshot_chunk( + async def verify_vote_extension( self, - request_apply_snapshot_chunk: "RequestApplySnapshotChunk", + request_verify_vote_extension: "RequestVerifyVoteExtension", *, timeout: Optional[float] = None, deadline: Optional["Deadline"] = None, metadata: Optional["MetadataLike"] = None - ) -> "ResponseApplySnapshotChunk": + ) -> "ResponseVerifyVoteExtension": return await self._unary_unary( - "/tendermint.abci.ABCIApplication/ApplySnapshotChunk", - request_apply_snapshot_chunk, - ResponseApplySnapshotChunk, + "/tendermint.abci.ABCI/VerifyVoteExtension", + request_verify_vote_extension, + ResponseVerifyVoteExtension, + timeout=timeout, + deadline=deadline, + metadata=metadata, + ) + + async def finalize_block( + self, + request_finalize_block: "RequestFinalizeBlock", + *, + timeout: Optional[float] = None, + deadline: Optional["Deadline"] = None, + metadata: Optional["MetadataLike"] = None + ) -> "ResponseFinalizeBlock": + return await self._unary_unary( + "/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) @@ -709,12 +880,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) @@ -724,19 +889,19 @@ async def query(self, request_query: "RequestQuery") -> "ResponseQuery": async def commit(self, request_commit: "RequestCommit") -> "ResponseCommit": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def init_chain(self, request_init_chain: "RequestInitChain") -> "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": + async def init_chain( + self, request_init_chain: "RequestInitChain" + ) -> "ResponseInitChain": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def list_snapshots(self, request_list_snapshots: "RequestListSnapshots") -> "ResponseListSnapshots": + async def list_snapshots( + self, request_list_snapshots: "RequestListSnapshots" + ) -> "ResponseListSnapshots": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def offer_snapshot(self, request_offer_snapshot: "RequestOfferSnapshot") -> "ResponseOfferSnapshot": + async def offer_snapshot( + self, request_offer_snapshot: "RequestOfferSnapshot" + ) -> "ResponseOfferSnapshot": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) async def load_snapshot_chunk( @@ -749,61 +914,80 @@ async def apply_snapshot_chunk( ) -> "ResponseApplySnapshotChunk": raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED) - async def __rpc_echo(self, stream: "grpclib.server.Stream[RequestEcho, ResponseEcho]") -> None: + 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: request = await stream.recv_message() response = await self.echo(request) await stream.send_message(response) - async def __rpc_flush(self, stream: "grpclib.server.Stream[RequestFlush, ResponseFlush]") -> None: + async def __rpc_flush( + self, stream: "grpclib.server.Stream[RequestFlush, ResponseFlush]" + ) -> None: request = await stream.recv_message() response = await self.flush(request) await stream.send_message(response) - async def __rpc_info(self, stream: "grpclib.server.Stream[RequestInfo, ResponseInfo]") -> None: + async def __rpc_info( + self, stream: "grpclib.server.Stream[RequestInfo, ResponseInfo]" + ) -> None: request = await stream.recv_message() 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: + async def __rpc_check_tx( + self, stream: "grpclib.server.Stream[RequestCheckTx, ResponseCheckTx]" + ) -> None: request = await stream.recv_message() response = await self.check_tx(request) await stream.send_message(response) - async def __rpc_query(self, stream: "grpclib.server.Stream[RequestQuery, ResponseQuery]") -> None: + async def __rpc_query( + self, stream: "grpclib.server.Stream[RequestQuery, ResponseQuery]" + ) -> None: request = await stream.recv_message() response = await self.query(request) await stream.send_message(response) - async def __rpc_commit(self, stream: "grpclib.server.Stream[RequestCommit, ResponseCommit]") -> None: + async def __rpc_commit( + self, stream: "grpclib.server.Stream[RequestCommit, ResponseCommit]" + ) -> None: request = await stream.recv_message() response = await self.commit(request) await stream.send_message(response) - async def __rpc_init_chain(self, stream: "grpclib.server.Stream[RequestInitChain, ResponseInitChain]") -> None: + async def __rpc_init_chain( + self, stream: "grpclib.server.Stream[RequestInitChain, ResponseInitChain]" + ) -> None: request = await stream.recv_message() 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]", @@ -836,96 +1020,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/pyband/proto/tendermint/crypto/__init__.py b/pyband/proto/tendermint/crypto/__init__.py index 8fe73bd..3b0be4d 100644 --- a/pyband/proto/tendermint/crypto/__init__.py +++ b/pyband/proto/tendermint/crypto/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: tendermint/crypto/keys.proto, tendermint/crypto/proof.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List @@ -34,9 +36,9 @@ class DominoOp(betterproto.Message): @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 nessecary data for example - neighbouring node hash + ProofOp defines an operation used for calculating Merkle root + The data could be arbitrary format, providing nessecary data + for example neighbouring node hash """ type: str = betterproto.string_field(1) @@ -53,9 +55,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/pyband/proto/tendermint/libs/bits/__init__.py b/pyband/proto/tendermint/libs/bits/__init__.py index 7de6e15..ace211c 100644 --- a/pyband/proto/tendermint/libs/bits/__init__.py +++ b/pyband/proto/tendermint/libs/bits/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: tendermint/libs/bits/types.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass from typing import List diff --git a/pyband/proto/tendermint/p2p/__init__.py b/pyband/proto/tendermint/p2p/__init__.py index bea424e..94d3a4a 100644 --- a/pyband/proto/tendermint/p2p/__init__.py +++ b/pyband/proto/tendermint/p2p/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: tendermint/p2p/types.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto diff --git a/pyband/proto/tendermint/types/__init__.py b/pyband/proto/tendermint/types/__init__.py index 866d952..20e8c14 100644 --- a/pyband/proto/tendermint/types/__init__.py +++ b/pyband/proto/tendermint/types/__init__.py @@ -1,6 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: tendermint/types/block.proto, tendermint/types/evidence.proto, tendermint/types/params.proto, tendermint/types/types.proto, tendermint/types/validator.proto # plugin: python-betterproto +# This file has been @generated import builtins from dataclasses import dataclass from datetime import ( @@ -20,24 +21,133 @@ class BlockIdFlag(betterproto.Enum): """BlockIdFlag indicates which BlockID the signature is for""" - BLOCK_ID_FLAG_UNKNOWN = 0 - BLOCK_ID_FLAG_ABSENT = 1 - BLOCK_ID_FLAG_COMMIT = 2 - BLOCK_ID_FLAG_NIL = 3 + UNKNOWN = 0 + ABSENT = 1 + COMMIT = 2 + NIL = 3 class SignedMsgType(betterproto.Enum): """SignedMsgType is a type of signed message in the consensus.""" - SIGNED_MSG_TYPE_UNKNOWN = 0 - SIGNED_MSG_TYPE_PREVOTE = 1 + UNKNOWN = 0 + PREVOTE = 1 """Votes""" - SIGNED_MSG_TYPE_PRECOMMIT = 2 - SIGNED_MSG_TYPE_PROPOSAL = 32 + PRECOMMIT = 2 + PROPOSAL = 32 """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 +194,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""" @@ -118,17 +228,17 @@ class Data(betterproto.Message): txs: List[bytes] = betterproto.bytes_field(1) """ - Txs that will be applied by state @ block.Height+1. NOTE: not all txs here - are valid. We're just agreeing on the order first. This means that - block.AppHash does not include these txs. + Txs that will be applied by state @ block.Height+1. + NOTE: not all txs here are valid. We're just agreeing on the order first. + This means that block.AppHash does not include these txs. """ @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,13 +249,29 @@ 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) class Commit(betterproto.Message): """ - Commit contains the evidence that a block was committed by a set of - validators. + Commit contains the evidence that a block was committed by a set of validators. """ height: int = betterproto.int64_field(1) @@ -164,6 +290,33 @@ 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) @@ -198,8 +351,7 @@ class BlockMeta(betterproto.Message): @dataclass(eq=False, repr=False) class TxProof(betterproto.Message): """ - TxProof represents a Merkle proof of the presence of a transaction in the - Merkle tree. + TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. """ root_hash: bytes = betterproto.bytes_field(1) @@ -207,102 +359,20 @@ 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(1, group="sum") - light_client_attack_evidence: "LightClientAttackEvidence" = betterproto.message_field(2, group="sum") + duplicate_vote_evidence: "DuplicateVoteEvidence" = betterproto.message_field( + 1, group="sum" + ) + light_client_attack_evidence: "LightClientAttackEvidence" = ( + betterproto.message_field(2, group="sum") + ) @dataclass(eq=False, repr=False) class DuplicateVoteEvidence(betterproto.Message): """ - DuplicateVoteEvidence contains evidence of a validator signed two - conflicting votes. + DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. """ vote_a: "Vote" = betterproto.message_field(1) @@ -315,8 +385,7 @@ class DuplicateVoteEvidence(betterproto.Message): @dataclass(eq=False, repr=False) class LightClientAttackEvidence(betterproto.Message): """ - LightClientAttackEvidence contains evidence of a set of validators - attempting to mislead a light client. + LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. """ conflicting_block: "LightBlock" = betterproto.message_field(1) diff --git a/pyband/proto/tendermint/version/__init__.py b/pyband/proto/tendermint/version/__init__.py index d79d35d..ff97bdb 100644 --- a/pyband/proto/tendermint/version/__init__.py +++ b/pyband/proto/tendermint/version/__init__.py @@ -1,6 +1,8 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # sources: tendermint/version/types.proto # plugin: python-betterproto +# This file has been @generated + from dataclasses import dataclass import betterproto @@ -9,9 +11,9 @@ @dataclass(eq=False, repr=False) class App(betterproto.Message): """ - App includes the protocol and software version for the application. This - information is included in ResponseInfo. The App.Protocol can be updated in - ResponseEndBlock. + App includes the protocol and software version for the application. + This information is included in ResponseInfo. The App.Protocol can be + updated in ResponseEndBlock. """ protocol: int = betterproto.uint64_field(1) @@ -21,9 +23,9 @@ class App(betterproto.Message): @dataclass(eq=False, repr=False) class Consensus(betterproto.Message): """ - Consensus captures the consensus rules for processing a block in the - blockchain, including all blockchain data structures and the rules of the - application's state transition machine. + Consensus captures the consensus rules for processing a block in the blockchain, + including all blockchain data structures and the rules of the application's + state transition machine. """ block: int = betterproto.uint64_field(1) diff --git a/pyband/transaction.py b/pyband/transaction.py index ca60019..f1d0fcc 100644 --- a/pyband/transaction.py +++ b/pyband/transaction.py @@ -10,7 +10,16 @@ from .messages.base import BaseMessageWrapper from .proto.cosmos.base.v1beta1 import Coin from .proto.cosmos.tx.signing.v1beta1 import SignMode -from .proto.cosmos.tx.v1beta1 import Fee, TxBody, ModeInfo, SignerInfo, AuthInfo, SignDoc, TxRaw, ModeInfoSingle +from .proto.cosmos.tx.v1beta1 import ( + Fee, + TxBody, + ModeInfo, + SignerInfo, + AuthInfo, + SignDoc, + TxRaw, + ModeInfoSingle, +) from .wallet.public_key import PublicKey @@ -105,7 +114,8 @@ def with_memo(self, memo: str) -> "Transaction": @property def fee(self): return Fee( - amount=[Coin(amount=str(ceil(self.gas_limit * self.gas_price)), denom="uband")], gas_limit=self.gas_limit + amount=[Coin(amount=str(ceil(self.gas_limit * self.gas_price)), denom="uband")], + gas_limit=self.gas_limit, ) def __generate_info(self, public_key: PublicKey, sign_mode: SignMode) -> Tuple[bytes, bytes]: @@ -148,7 +158,7 @@ def get_sign_doc(self, public_key: PublicKey = None) -> SignDoc: if self.chain_id is None: raise UndefinedError("chain_id should be defined") - body_bytes, auth_info_bytes = self.__generate_info(public_key, SignMode.SIGN_MODE_DIRECT) + body_bytes, auth_info_bytes = self.__generate_info(public_key, SignMode.DIRECT) return SignDoc( body_bytes=body_bytes, @@ -178,7 +188,10 @@ def get_sign_message_for_legacy_codec(self) -> bytes: return json.dumps(msg, separators=(",", ":"), sort_keys=True).encode("utf-8") def get_tx_data( - self, signature: bytes, public_key: PublicKey = None, sign_mode: SignMode = SignMode.SIGN_MODE_DIRECT + self, + signature: bytes, + public_key: PublicKey = None, + sign_mode: SignMode = SignMode.DIRECT, ) -> bytes: """Returns the transaction as a byte. @@ -192,5 +205,9 @@ def get_tx_data( """ body_bytes, auth_info_bytes = self.__generate_info(public_key, sign_mode) - tx_raw = TxRaw(body_bytes=body_bytes, auth_info_bytes=auth_info_bytes, signatures=[signature]) + tx_raw = TxRaw( + body_bytes=body_bytes, + auth_info_bytes=auth_info_bytes, + signatures=[signature], + ) return bytes(tx_raw) diff --git a/pyband/wallet/signer.py b/pyband/wallet/signer.py index 2289f3e..0788ecb 100644 --- a/pyband/wallet/signer.py +++ b/pyband/wallet/signer.py @@ -64,11 +64,17 @@ def __init__(self, path: str, app: CosmosApp): self.cosmos_app = app if app is not None else CosmosApp(bip44_to_list(path)) def get_public_key(self) -> PublicKey: - return PublicKey.from_hex(self.cosmos_app.ins_get_addr_secp256k1(BECH32_ADDR_ACC_PREFIX, False).public_key) + return PublicKey.from_hex( + self.cosmos_app.ins_get_addr_secp256k1( + BECH32_ADDR_ACC_PREFIX, False + ).public_key + ) def get_address(self) -> Address: return Address.from_acc_bech32( - self.cosmos_app.ins_get_addr_secp256k1(BECH32_ADDR_ACC_PREFIX, False).address.decode() + self.cosmos_app.ins_get_addr_secp256k1( + BECH32_ADDR_ACC_PREFIX, False + ).address.decode() ) def sign(self, msg: bytes) -> bytes: diff --git a/pyband/wallet/wallet.py b/pyband/wallet/wallet.py index d990b74..97d06bc 100644 --- a/pyband/wallet/wallet.py +++ b/pyband/wallet/wallet.py @@ -26,7 +26,9 @@ def from_mnemonic(cls, mnemonic: str, path: str = DEFAULT_DERIVATION_PATH): A Wallet instance. """ - return cls(PrivateKeySigner(PrivateKey.from_mnemonic(mnemonic, path)), SignMode.SIGN_MODE_DIRECT) + return cls( + PrivateKeySigner(PrivateKey.from_mnemonic(mnemonic, path)), SignMode.DIRECT + ) @classmethod def from_private_key(cls, private_key: str): @@ -39,10 +41,12 @@ def from_private_key(cls, private_key: str): A Wallet instance. """ - return cls(PrivateKeySigner(PrivateKey.from_hex(private_key)), SignMode.SIGN_MODE_DIRECT) + return cls(PrivateKeySigner(PrivateKey.from_hex(private_key)), SignMode.DIRECT) @classmethod - def from_ledger(cls, path: str = DEFAULT_LEDGER_DERIVATION_PATH, *, app: CosmosApp = None): + def from_ledger( + cls, path: str = DEFAULT_LEDGER_DERIVATION_PATH, *, app: CosmosApp = None + ): """Creates a Wallet instance from a connected Ledger. Args: @@ -54,8 +58,11 @@ def from_ledger(cls, path: str = DEFAULT_LEDGER_DERIVATION_PATH, *, app: CosmosA """ return cls( - LedgerSigner(path=path, app=app if app is not None else CosmosApp(bip44_to_list(path))), - SignMode.SIGN_MODE_LEGACY_AMINO_JSON, + LedgerSigner( + path=path, + app=app if app is not None else CosmosApp(bip44_to_list(path)), + ), + SignMode.LEGACY_AMINO_JSON, ) def get_public_key(self) -> PublicKey: @@ -87,10 +94,12 @@ def sign_and_build(self, tx: Transaction) -> bytes: """ public_key = self.get_public_key() - if self._sign_mode == SignMode.SIGN_MODE_LEGACY_AMINO_JSON: + if self._sign_mode == SignMode.LEGACY_AMINO_JSON: sign_msg = tx.get_sign_message_for_legacy_codec() - else: + elif self._sign_mode == SignMode.DIRECT: sign_msg = tx.get_sign_doc(public_key) + else: + raise NotImplementedError(f"Sign mode {self._sign_mode} is not supported") signature = self._signer.sign(bytes(sign_msg)) return tx.get_tx_data(signature, public_key, sign_mode=self._sign_mode) diff --git a/pyproject.toml b/pyproject.toml index cb022ec..caa8dd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,11 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] description = "Python library for BandChain" documentation = "https://docs.bandchain.org/client-library/pyband/getting-started.html" @@ -17,15 +19,15 @@ license = "MIT" name = "pyband" readme = "README.md" repository = "https://github.com/bandprotocol/pyband" -version = "0.3.5" +version = "0.4.0-rc1" [tool.poetry.dependencies] bech32 = "1.2.0" -betterproto = "2.0.0b5" +betterproto = "2.0.0b7" bip32 = "0.0.8" -ecdsa = "0.15" +ecdsa = "0.19.0" grpclib = "0.4.3" -ledgerblue = "^0.1.45" +ledgerblue = "^0.1.54" mnemonic = "0.19" python = "^3.7" python-dateutil = "2.8.2" diff --git a/tests/client/client_test.py b/tests/client/client_test.py index 0dfe915..d1a2dba 100644 --- a/tests/client/client_test.py +++ b/tests/client/client_test.py @@ -9,19 +9,39 @@ from pyband.client import Client from pyband.exceptions import NotFoundError, EmptyMsgError -from pyband.proto.cosmos.auth.v1beta1 import BaseAccount -from pyband.proto.cosmos.auth.v1beta1 import QueryAccountResponse +from pyband.proto.cosmos.auth.v1beta1 import ( + BaseAccount, + QueryAccountInfoRequest, + QueryAccountInfoResponse, +) from pyband.proto.cosmos.auth.v1beta1 import QueryBase as CosmosAuthServiceBase -from pyband.proto.cosmos.base.abci.v1beta1 import TxResponse, AbciMessageLog, StringEvent, Attribute -from pyband.proto.cosmos.base.tendermint.v1beta1 import GetLatestBlockResponse, GetLatestBlockRequest -from pyband.proto.cosmos.base.tendermint.v1beta1 import ServiceBase as TendermintServiceBase +from pyband.proto.cosmos.base.abci.v1beta1 import ( + TxResponse, + AbciMessageLog, + StringEvent, + Attribute, +) +from pyband.proto.cosmos.base.tendermint.v1beta1 import ( + GetLatestBlockResponse, + GetLatestBlockRequest, +) +from pyband.proto.cosmos.base.tendermint.v1beta1 import ( + ServiceBase as TendermintServiceBase, +) from pyband.proto.cosmos.tx.signing.v1beta1 import SignMode from pyband.proto.cosmos.tx.v1beta1 import GetTxRequest, GetTxResponse, ModeInfoSingle from pyband.proto.cosmos.tx.v1beta1 import ServiceBase as CosmosTxServiceBase -from pyband.proto.cosmos.tx.v1beta1 import Tx, TxBody, AuthInfo, SignerInfo, ModeInfo, Fee -from pyband.proto.oracle.v1 import DataSource, OracleScript -from pyband.proto.oracle.v1 import QueryBase as OracleQueryBase -from pyband.proto.oracle.v1 import ( +from pyband.proto.cosmos.tx.v1beta1 import ( + Tx, + TxBody, + AuthInfo, + SignerInfo, + ModeInfo, + Fee, +) +from pyband.proto.band.oracle.v1 import DataSource, OracleScript +from pyband.proto.band.oracle.v1 import QueryBase as OracleQueryBase +from pyband.proto.band.oracle.v1 import ( QueryDataSourceRequest, QueryDataSourceResponse, QueryOracleScriptResponse, @@ -34,7 +54,7 @@ QueryRequestSearchRequest, QueryRequestSearchResponse, ) -from pyband.proto.oracle.v1 import ( +from pyband.proto.band.oracle.v1 import ( Result, Report, Request, @@ -58,7 +78,9 @@ class OracleService(OracleQueryBase): - async def data_source(self, query_data_source_request: QueryDataSourceRequest) -> QueryDataSourceResponse: + async def data_source( + self, query_data_source_request: QueryDataSourceRequest + ) -> QueryDataSourceResponse: if query_data_source_request.data_source_id == 1: return QueryDataSourceResponse( data_source=DataSource( @@ -70,7 +92,9 @@ async def data_source(self, query_data_source_request: QueryDataSourceRequest) - ) ) - async def oracle_script(self, query_oracle_script_request: QueryOracleScriptResponse) -> QueryOracleScriptResponse: + async def oracle_script( + self, query_oracle_script_request: QueryOracleScriptResponse + ) -> QueryOracleScriptResponse: if query_oracle_script_request.oracle_script_id == 1: return QueryOracleScriptResponse( oracle_script=OracleScript( @@ -83,7 +107,9 @@ async def oracle_script(self, query_oracle_script_request: QueryOracleScriptResp ) ) - async def request(self, query_request_request: QueryRequestRequest) -> QueryRequestResponse: + async def request( + self, query_request_request: QueryRequestRequest + ) -> QueryRequestResponse: if query_request_request.request_id == 1: return QueryRequestResponse( request=Request( @@ -114,7 +140,9 @@ async def request(self, query_request_request: QueryRequestRequest) -> QueryRequ raw_reports=[ RawReport(external_id=1, exit_code=0, data=b"NTczMjcK"), RawReport(external_id=2, exit_code=0, data=b"NTczMjcK"), - RawReport(external_id=3, exit_code=0, data=b"NTcyODYuMDE1Cg=="), + RawReport( + external_id=3, exit_code=0, data=b"NTcyODYuMDE1Cg==" + ), ], ), ], @@ -128,12 +156,14 @@ async def request(self, query_request_request: QueryRequestRequest) -> QueryRequ ans_count=2, request_time=1620798812, resolve_time=1620798814, - resolve_status=ResolveStatus.RESOLVE_STATUS_SUCCESS, + resolve_status=ResolveStatus.SUCCESS, result=b"AAAAAANqiDo=", ), ) - async def reporters(self, query_reporters_request: QueryReportersRequest) -> QueryReportersResponse: + async def reporters( + self, query_reporters_request: QueryReportersRequest + ) -> QueryReportersResponse: return QueryReportersResponse( reporter=[ "band1yyv5jkqaukq0ajqn7vhkyhpff7h6e99ja7gvwg", @@ -145,7 +175,9 @@ async def reporters(self, query_reporters_request: QueryReportersRequest) -> Que ] ) - async def request_price(self, query_request_price_request: QueryRequestPriceRequest): + async def request_price( + self, query_request_price_request: QueryRequestPriceRequest + ): # Assume that price = 10 will return price not found error if query_request_price_request.ask_count != 10: return QueryRequestPriceResponse( @@ -174,7 +206,9 @@ async def request_price(self, query_request_price_request: QueryRequestPriceRequ ] ) - async def request_search(self, query_request_search_request: QueryRequestSearchRequest): + async def request_search( + self, query_request_search_request: QueryRequestSearchRequest + ): return QueryRequestSearchResponse( request=QueryRequestResponse( request=Request( @@ -265,7 +299,7 @@ async def request_search(self, query_request_search_request: QueryRequestSearchR ans_count=12, request_time=1625077316, resolve_time=1625077324, - resolve_status=ResolveStatus.RESOLVE_STATUS_SUCCESS, + resolve_status=ResolveStatus.SUCCESS, result=b"\000\000\000@\313\022\372/\200fpH\305\367\204\020h9\220\2621\336\276#\024m\323\322\271\213Q\331-\244\364\326\310\002\202o.\305&\300\345\177\312T\t\216\023{\213\311\035\300\350z\0246\337\316\326\220 x\270\333", ), ) @@ -281,7 +315,7 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: body=TxBody( messages=[ Any( - type_url="/oracle.v1.MsgRequestData", + type_url="/oracle.v1beta1.MsgRequestData", value=b"\010%\0220\000\000\000\005\000\000\000\003ETH\000\000\000\003BTC\000\000\000\004BAND\000\000\000\003MIR\000\000\000\003UNI\000\000\000\000\000\000\000d\030\020 \n*\014from_bandd_28\320\206\003@\340\247\022J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q", ) ] @@ -293,7 +327,9 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: type_url="/cosmos.crypto.secp256k1.PubKey", value=b"\n!\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223", ), - mode_info=ModeInfo(ModeInfoSingle(mode=SignMode.SIGN_MODE_DIRECT)), + mode_info=ModeInfo( + ModeInfoSingle(mode=SignMode.DIRECT) + ), sequence=478, ) ], @@ -311,7 +347,12 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: logs=[ AbciMessageLog( events=[ - StringEvent(type="message", attributes=[Attribute(key="action", value="request")]), + StringEvent( + type="message", + attributes=[ + Attribute(key="action", value="request") + ], + ), StringEvent( type="raw_request", attributes=[ @@ -327,7 +368,9 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: type="report", attributes=[ Attribute(key="id", value="154966"), - Attribute(key="client_id", value="from_bandd_2"), + Attribute( + key="client_id", value="from_bandd_2" + ), Attribute(key="oracle_script_id", value="37"), ], ), @@ -338,7 +381,7 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: gas_used=1059525, tx=Any( type_url="/cosmos.tx.v1beta1.Tx", - value=b'\n\233\001\n\230\001\n\031/oracle.v1.MsgRequestData\022{\010%\0220\000\000\000\005\000\000\000\003ETH\000\000\000\003BTC\000\000\000\004BAND\000\000\000\003MIR\000\000\000\003UNI\000\000\000\000\000\000\000d\030\020 \n*\014from_bandd_28\320\206\003@\340\247\022J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q\022Y\nQ\nF\n\037/cosmos.crypto.secp256k1.PubKey\022#\n!\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223\022\004\n\002\010\001\030\336\003\022\004\020\200\211z\032@4\331\316\363\241L\342\217\201L"\311\002\036\324E\0163\377L\261\263Q\277\333\252\215\205\323,5L8D\254Q\376\312\314\261\243\020\214\213\325\316\314\226rw\177Y\026&E\r\344\312\n\321~\325\025\340', + value=b'\n\233\001\n\230\001\n\031/oracle.v1beta1.MsgRequestData\022{\010%\0220\000\000\000\005\000\000\000\003ETH\000\000\000\003BTC\000\000\000\004BAND\000\000\000\003MIR\000\000\000\003UNI\000\000\000\000\000\000\000d\030\020 \n*\014from_bandd_28\320\206\003@\340\247\022J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q\022Y\nQ\nF\n\037/cosmos.crypto.secp256k1.PubKey\022#\n!\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223\022\004\n\002\010\001\030\336\003\022\004\020\200\211z\032@4\331\316\363\241L\342\217\201L"\311\002\036\324E\0163\377L\261\263Q\277\333\252\215\205\323,5L8D\254Q\376\312\314\261\243\020\214\213\325\316\314\226rw\177Y\026&E\r\344\312\n\321~\325\025\340', ), timestamp="2021-06-04T06:07:37Z", ), @@ -349,7 +392,7 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: body=TxBody( messages=[ Any( - type_url="/oracle.v1.MsgRequestData", + type_url="/oracle.v1beta1.MsgRequestData", value=b"\010%\0220\000\000\000\005\000\000\000\003ETH\000\000\000\003BTC\000\000\000\004BAND\000\000\000\003MIR\000\000\000\003UNI\000\000\000\000\000\000\000d\030\020 \n*\014from_bandd_28\320\206\003@\340\247\022J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q", ) ] @@ -361,7 +404,9 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: type_url="/cosmos.crypto.secp256k1.PubKey", value=b"\n!\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223", ), - mode_info=ModeInfo(ModeInfoSingle(mode=SignMode.SIGN_MODE_DIRECT)), + mode_info=ModeInfo( + ModeInfoSingle(mode=SignMode.DIRECT) + ), sequence=478, ) ], @@ -379,7 +424,12 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: logs=[ AbciMessageLog( events=[ - StringEvent(type="message", attributes=[Attribute(key="action", value="request")]), + StringEvent( + type="message", + attributes=[ + Attribute(key="action", value="request") + ], + ), StringEvent( type="raw_request", attributes=[ @@ -395,7 +445,9 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: type="request", attributes=[ Attribute(key="id", value="111111"), - Attribute(key="client_id", value="from_bandd_2"), + Attribute( + key="client_id", value="from_bandd_2" + ), Attribute(key="oracle_script_id", value="37"), ], ), @@ -403,7 +455,12 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: ), AbciMessageLog( events=[ - StringEvent(type="message", attributes=[Attribute(key="action", value="request")]), + StringEvent( + type="message", + attributes=[ + Attribute(key="action", value="request") + ], + ), StringEvent( type="raw_request", attributes=[ @@ -419,7 +476,9 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: type="request", attributes=[ Attribute(key="id", value="222222"), - Attribute(key="client_id", value="from_bandd_2"), + Attribute( + key="client_id", value="from_bandd_2" + ), Attribute(key="oracle_script_id", value="37"), ], ), @@ -430,7 +489,7 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: gas_used=1059525, tx=Any( type_url="/cosmos.tx.v1beta1.Tx", - value=b'\n\233\001\n\230\001\n\031/oracle.v1.MsgRequestData\022{\010%\0220\000\000\000\005\000\000\000\003ETH\000\000\000\003BTC\000\000\000\004BAND\000\000\000\003MIR\000\000\000\003UNI\000\000\000\000\000\000\000d\030\020 \n*\014from_bandd_28\320\206\003@\340\247\022J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q\022Y\nQ\nF\n\037/cosmos.crypto.secp256k1.PubKey\022#\n!\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223\022\004\n\002\010\001\030\336\003\022\004\020\200\211z\032@4\331\316\363\241L\342\217\201L"\311\002\036\324E\0163\377L\261\263Q\277\333\252\215\205\323,5L8D\254Q\376\312\314\261\243\020\214\213\325\316\314\226rw\177Y\026&E\r\344\312\n\321~\325\025\340', + value=b'\n\233\001\n\230\001\n\031/oracle.v1beta1.MsgRequestData\022{\010%\0220\000\000\000\005\000\000\000\003ETH\000\000\000\003BTC\000\000\000\004BAND\000\000\000\003MIR\000\000\000\003UNI\000\000\000\000\000\000\000d\030\020 \n*\014from_bandd_28\320\206\003@\340\247\022J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q\022Y\nQ\nF\n\037/cosmos.crypto.secp256k1.PubKey\022#\n!\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223\022\004\n\002\010\001\030\336\003\022\004\020\200\211z\032@4\331\316\363\241L\342\217\201L"\311\002\036\324E\0163\377L\261\263Q\277\333\252\215\205\323,5L8D\254Q\376\312\314\261\243\020\214\213\325\316\314\226rw\177Y\026&E\r\344\312\n\321~\325\025\340', ), timestamp="2021-06-04T06:07:37Z", ), @@ -438,16 +497,28 @@ async def get_tx(self, get_tx_request: GetTxRequest) -> GetTxResponse: class AuthService(CosmosAuthServiceBase): - async def account(self, query_account_request) -> QueryAccountResponse: + async def account_info( + self, query_account_request: QueryAccountInfoRequest + ) -> QueryAccountInfoResponse: if query_account_request.address == "noAccount": raise NotFoundError("Account not found") - # Account exist - base_acc = BaseAccount(account_number=1) - return QueryAccountResponse(account=Any(type_url="/cosmos.auth.v1beta1.BaseAccount", value=bytes(base_acc))) + + base_account = BaseAccount( + address="band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", + pub_key=Any( + type_url="/cosmos.crypto.secp256k1.PubKey", + value=b"\n\021\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223", + ), + account_number=1, + sequence=0, + ) + return QueryAccountInfoResponse(info=base_account) class TendermintService(TendermintServiceBase): - async def get_latest_block(self, get_latest_block_request: GetLatestBlockRequest) -> GetLatestBlockResponse: + async def get_latest_block( + self, get_latest_block_request: GetLatestBlockRequest + ) -> GetLatestBlockResponse: return GetLatestBlockResponse( block_id=BlockId( hash=b"391E99908373F8590C928E0619956DA3D87EB654445DA4F25A185C9718561D53", @@ -497,13 +568,13 @@ async def get_latest_block(self, get_latest_block_request: GetLatestBlockRequest ), signatures=[ CommitSig( - block_id_flag=BlockIdFlag.BLOCK_ID_FLAG_NIL, + block_id_flag=BlockIdFlag.NIL, validator_address=b"5179B0BB203248E03D2A1342896133B5C58E1E44", timestamp=parser.isoparse("2020-11-05T09:15:18.53815896Z"), signature=b"TZY24CKwZOE8wqfE0NM3qzkQ7qCpCrGEHNZdf8n31L4otZzbKGfOL05kGtBsGkTnZkVv7aJmrJ7XbvIzv0SREQ==", ), CommitSig( - block_id_flag=BlockIdFlag.BLOCK_ID_FLAG_NIL, + block_id_flag=BlockIdFlag.NIL, validator_address=b"5179B0BB203248E03D2A1342896133B5C58E1E44", timestamp=parser.isoparse("2020-11-05T09:15:18.53815896Z"), signature=b"TZY24CKwZOE8wqfE0NM3qzkQ7qCpCrGEHNZdf8n31L4otZzbKGfOL05kGtBsGkTnZkVv7aJmrJ7XbvIzv0SREQ==", @@ -517,7 +588,12 @@ async def get_latest_block(self, get_latest_block_request: GetLatestBlockRequest @pytest_asyncio.fixture(scope="module") async def pyband_client(): channel_for = ChannelFor( - services=[OracleService(), CosmosTransactionService(), AuthService(), TendermintService()] + services=[ + OracleService(), + CosmosTransactionService(), + AuthService(), + TendermintService(), + ] ) channel = await channel_for.__aenter__() yield Client(channel) @@ -636,7 +712,7 @@ async def test_get_request_by_id_success(pyband_client): ans_count=2, request_time=1620798812, resolve_time=1620798814, - resolve_status=ResolveStatus.RESOLVE_STATUS_SUCCESS, + resolve_status=ResolveStatus.SUCCESS, result=b"AAAAAANqiDo=", ), ) @@ -736,13 +812,13 @@ async def test_get_latest_block(pyband_client): ), signatures=[ CommitSig( - block_id_flag=BlockIdFlag.BLOCK_ID_FLAG_NIL, + block_id_flag=BlockIdFlag.NIL, validator_address=b"5179B0BB203248E03D2A1342896133B5C58E1E44", timestamp=parser.isoparse("2020-11-05T09:15:18.53815896Z"), signature=b"TZY24CKwZOE8wqfE0NM3qzkQ7qCpCrGEHNZdf8n31L4otZzbKGfOL05kGtBsGkTnZkVv7aJmrJ7XbvIzv0SREQ==", ), CommitSig( - block_id_flag=BlockIdFlag.BLOCK_ID_FLAG_NIL, + block_id_flag=BlockIdFlag.NIL, validator_address=b"5179B0BB203248E03D2A1342896133B5C58E1E44", timestamp=parser.isoparse("2020-11-05T09:15:18.53815896Z"), signature=b"TZY24CKwZOE8wqfE0NM3qzkQ7qCpCrGEHNZdf8n31L4otZzbKGfOL05kGtBsGkTnZkVv7aJmrJ7XbvIzv0SREQ==", @@ -756,7 +832,9 @@ async def test_get_latest_block(pyband_client): @pytest.mark.asyncio async def test_get_account_success(pyband_client): - account = await pyband_client.get_account("xxx") + account = await pyband_client.get_account( + "band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c" + ) assert account.account_number == 1 @@ -792,7 +870,9 @@ async def test_get_chain_id(pyband_client): @pytest.mark.asyncio async def test_get_reference_data_success(pyband_client): - [reference_data1, reference_data2] = await pyband_client.get_reference_data(["ETH/USD", "BTC/USDT"], 3, 4) + [reference_data1, reference_data2] = await pyband_client.get_reference_data( + ["ETH/USD", "BTC/USDT"], 3, 4 + ) assert reference_data1.pair == "ETH/USD" assert reference_data2.pair == "BTC/USDT" assert reference_data1.rate == 2317.61 @@ -913,7 +993,7 @@ async def test_get_latest_request_success(pyband_client): ans_count=12, request_time=1625077316, resolve_time=1625077324, - resolve_status=ResolveStatus.RESOLVE_STATUS_SUCCESS, + resolve_status=ResolveStatus.SUCCESS, result=b"\000\000\000@\313\022\372/\200fpH\305\367\204\020h9\220\2621\336\276#\024m\323\322\271\213Q\331-\244\364\326\310\002\202o.\305&\300\345\177\312T\t\216\023{\213\311\035\300\350z\0246\337\316\326\220 x\270\333", ), ) @@ -932,7 +1012,10 @@ async def test_get_tx_resp(pyband_client): logs=[ AbciMessageLog( events=[ - StringEvent(type="message", attributes=[Attribute(key="action", value="request")]), + StringEvent( + type="message", + attributes=[Attribute(key="action", value="request")], + ), StringEvent( type="raw_request", attributes=[ @@ -959,7 +1042,7 @@ async def test_get_tx_resp(pyband_client): gas_used=1059525, tx=Any( type_url="/cosmos.tx.v1beta1.Tx", - value=b'\n\x9b\x01\n\x98\x01\n\x19/oracle.v1.MsgRequestData\x12{\x08%\x120\x00\x00\x00\x05\x00\x00\x00\x03ETH\x00\x00\x00\x03BTC\x00\x00\x00\x04BAND\x00\x00\x00\x03MIR\x00\x00\x00\x03UNI\x00\x00\x00\x00\x00\x00\x00d\x18\x10 \n*\x0cfrom_bandd_28\xd0\x86\x03@\xe0\xa7\x12J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q\x12Y\nQ\nF\n\x1f/cosmos.crypto.secp256k1.PubKey\x12#\n!\x03\x8c\x89\xad\xa3\xb4\x8e\xc5\xf3,\xf8\xda\x8cC\xee\x12yM?9\x87B?\xf9\x88\x02\xd5\xfc\xf6\xeeC\x11\x93\x12\x04\n\x02\x08\x01\x18\xde\x03\x12\x04\x10\x80\x89z\x1a@4\xd9\xce\xf3\xa1L\xe2\x8f\x81L"\xc9\x02\x1e\xd4E\x0e3\xffL\xb1\xb3Q\xbf\xdb\xaa\x8d\x85\xd3,5L8D\xacQ\xfe\xca\xcc\xb1\xa3\x10\x8c\x8b\xd5\xce\xcc\x96rw\x7fY\x16&E\r\xe4\xca\n\xd1~\xd5\x15\xe0', + value=b'\n\x9b\x01\n\x98\x01\n\x19/oracle.v1beta1.MsgRequestData\x12{\x08%\x120\x00\x00\x00\x05\x00\x00\x00\x03ETH\x00\x00\x00\x03BTC\x00\x00\x00\x04BAND\x00\x00\x00\x03MIR\x00\x00\x00\x03UNI\x00\x00\x00\x00\x00\x00\x00d\x18\x10 \n*\x0cfrom_bandd_28\xd0\x86\x03@\xe0\xa7\x12J+band1ky9tdhvr6669skylg02sv5ckvra84gn6vpfc8q\x12Y\nQ\nF\n\x1f/cosmos.crypto.secp256k1.PubKey\x12#\n!\x03\x8c\x89\xad\xa3\xb4\x8e\xc5\xf3,\xf8\xda\x8cC\xee\x12yM?9\x87B?\xf9\x88\x02\xd5\xfc\xf6\xeeC\x11\x93\x12\x04\n\x02\x08\x01\x18\xde\x03\x12\x04\x10\x80\x89z\x1a@4\xd9\xce\xf3\xa1L\xe2\x8f\x81L"\xc9\x02\x1e\xd4E\x0e3\xffL\xb1\xb3Q\xbf\xdb\xaa\x8d\x85\xd3,5L8D\xacQ\xfe\xca\xcc\xb1\xa3\x10\x8c\x8b\xd5\xce\xcc\x96rw\x7fY\x16&E\r\xe4\xca\n\xd1~\xd5\x15\xe0', ), timestamp="2021-06-04T06:07:37Z", ) diff --git a/tests/client/send_tx_test.py b/tests/client/send_tx_test.py index 1ed8208..432bb6d 100644 --- a/tests/client/send_tx_test.py +++ b/tests/client/send_tx_test.py @@ -5,14 +5,21 @@ from grpclib.testing import ChannelFor from pyband import Client -from pyband.proto.cosmos.base.abci.v1beta1 import TxResponse, AbciMessageLog, StringEvent, Attribute +from pyband.proto.cosmos.base.abci.v1beta1 import ( + TxResponse, + AbciMessageLog, + StringEvent, + Attribute, +) from pyband.proto.cosmos.tx.v1beta1 import BroadcastTxRequest, BroadcastTxResponse from pyband.proto.cosmos.tx.v1beta1 import ServiceBase as CosmosTxServiceBase # Note: Success, if code = 0 class CosmosTransactionService(CosmosTxServiceBase): - async def broadcast_tx(self, broadcast_tx_request: BroadcastTxRequest) -> BroadcastTxResponse: + async def broadcast_tx( + self, broadcast_tx_request: BroadcastTxRequest + ) -> BroadcastTxResponse: if broadcast_tx_request.tx_bytes == b"async_any_hash": return BroadcastTxResponse( tx_response=TxResponse( @@ -139,189 +146,3 @@ async def test_send_tx_sync_mode_invalid_bytes(pyband_client): async def test_send_tx_sync_mode_invalid_input(pyband_client): with pytest.raises(TypeError): await pyband_client.send_tx_sync_mode(1) - - -# Block mode: wait for tx to be committed to a block -@pytest.mark.asyncio -async def test_send_tx_block_mode_success(pyband_client): - tx_response = await pyband_client.send_tx_block_mode(b"block_success") - mock_result = block_mode_success_result.tx_response - assert tx_response == mock_result - - -@pytest.mark.asyncio -async def test_send_tx_block_mode_out_of_gas(pyband_client): - tx_response = await pyband_client.send_tx_block_mode(b"block_out_of_gas") - mock_result = BroadcastTxResponse( - tx_response=TxResponse( - height=1284491, - txhash="2CE53A417435AD62F14C27535E19E6B5B2B0FDBF4CDC3532148DAE29BE5666BE", - codespace="sdk", - code=11, - raw_log="out of gas in location: PER_VALIDATOR_REQUEST_FEE; gasWanted: 200000, gasUsed: 517238: out of gas", - gas_wanted=200000, - gas_used=517238, - ) - ) - assert tx_response == mock_result.tx_response - - -# Fail if code != 0 -@pytest.mark.asyncio -async def test_send_tx_block_mode_fail(pyband_client): - tx_response = await pyband_client.send_tx_block_mode(b"block_fail") - mock_result = BroadcastTxResponse( - tx_response=TxResponse( - txhash="CC06ABAE35591E6668451D9B05D04A0E0C4257A582E4D714975363260A092233", - codespace="sdk", - code=5, - raw_log="0uband, is smaller than 9000000uband: insufficient funds: insufficient funds", - gas_wanted=5000000, - gas_used=21747, - ) - ) - assert tx_response == mock_result.tx_response - - -# Fail if code != 0, invalid bytes code = 2 -@pytest.mark.asyncio -async def test_send_tx_block_mode_invalid_bytes(pyband_client): - tx_response = await pyband_client.send_tx_block_mode(b"block_fail_wrong_bytes") - mock_result = BroadcastTxResponse( - tx_response=TxResponse( - txhash="7CA12506E88CF8B814E20848B229460F91FC0370C44A7C4FEE786960CE30C36D", - codespace="sdk", - code=2, - raw_log='errUnknownField "*tx.TxRaw": {TagNum: 14, WireType:"start_group"}: tx parse error', - gas_used=6429, - ) - ) - assert tx_response == mock_result.tx_response - - -@pytest.mark.asyncio -async def test_send_tx_block_mode_invalid_input(pyband_client): - with pytest.raises(TypeError): - await pyband_client.send_tx_block_mode(1) - - -block_mode_success_result = BroadcastTxResponse( - tx_response=TxResponse( - height=1285934, - txhash="767353B21A770E7D02E71BDCDD75AB5AB3F60E86CB4633A1BE49BEECA8A8CE4E", - data="0A090A0772657175657374", - raw_log="[{'events':[{'type':'message','attributes':[{'key':'action','value':'request'}]},{'type':'raw_request','attributes':[{'key':'data_source_id','value':'61'},{'key':'data_source_hash','value':'07be7bd61667327aae10b7a13a542c7dfba31b8f4c52b0b60bf9c7b11b1a72ef'},{'key':'external_id','value':'6'},{'key':'calldata','value':'ETH'},{'key':'data_source_id','value':'57'},{'key':'data_source_hash','value':'61b369daa5c0918020a52165f6c7662d5b9c1eee915025cb3d2b9947a26e48c7'},{'key':'external_id','value':'0'},{'key':'calldata','value':'ETH'},{'key':'data_source_id','value':'62'},{'key':'data_source_hash','value':'107048da9dbf7960c79fb20e0585e080bb9be07d42a1ce09c5479bbada8d0289'},{'key':'external_id','value':'3'},{'key':'calldata','value':'ETH'},{'key':'data_source_id','value':'60'},{'key':'data_source_hash','value':'2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac'},{'key':'external_id','value':'5'},{'key':'calldata','value':'huobipro ETH'},{'key':'data_source_id','value':'59'},{'key':'data_source_hash','value':'5c011454981c473af3bf6ef93c76b36bfb6cc0ce5310a70a1ba569de3fc0c15d'},{'key':'external_id','value':'2'},{'key':'calldata','value':'ETH'},{'key':'data_source_id','value':'60'},{'key':'data_source_hash','value':'2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac'},{'key':'external_id','value':'4'},{'key':'calldata','value':'binance ETH'},{'key':'data_source_id','value':'60'},{'key':'data_source_hash','value':'2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac'},{'key':'external_id','value':'9'},{'key':'calldata','value':'bittrex ETH'},{'key':'data_source_id','value':'60'},{'key':'data_source_hash','value':'2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac'},{'key':'external_id','value':'7'},{'key':'calldata','value':'kraken ETH'},{'key':'data_source_id','value':'60'},{'key':'data_source_hash','value':'2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac'},{'key':'external_id','value':'8'},{'key':'calldata','value':'bitfinex ETH'},{'key':'data_source_id','value':'58'},{'key':'data_source_hash','value':'7e6759fade717a06fb643392bfde837bfc3437da2ded54feed706e6cd35de461'},{'key':'external_id','value':'1'},{'key':'calldata','value':'ETH'}]},{'type':'request','attributes':[{'key':'id','value':'287004'},{'key':'client_id','value':'Blue'},{'key':'oracle_script_id','value':'37'},{'key':'calldata','value':'00000001000000034554480000000000000064'},{'key':'ask_count','value':'16'},{'key':'min_count','value':'10'},{'key':'gas_used','value':'71512'},{'key':'validator','value':'bandvaloper18tjynh8v0kvf9lmjenx02fgltxk0c6jmm2wcjc'},{'key':'validator','value':'bandvaloper1w46umthap3cmvqarrznauy25mdhqu45tv8hq62'},{'key':'validator','value':'bandvaloper1qudzmeu5yr7ryaq9spfpurptvlv4mxehe8x86e'},{'key':'validator','value':'bandvaloper1nlepx7xg53fsy6vslrss6adtmtl8a33kusv7fa'},{'key':'validator','value':'bandvaloper1npezmz5cw208gm7l7nhay5xm6h5k4we5axn663'},{'key':'validator','value':'bandvaloper1d0kcwzukkjl2w2nty3xerqpy3ypdrph67hxx4v'},{'key':'validator','value':'bandvaloper19j74weeme5ehvmfnduz5swkxysz4twg92swxaf'},{'key':'validator','value':'bandvaloper1ejnk6k8ny3y5kwr234m3y32p7dxsx2a0wvcpyl'},{'key':'validator','value':'bandvaloper185sr49ntmfzfc5z52eh0z5m2vjvahwqa6qvk27'},{'key':'validator','value':'bandvaloper106e65xpz88s5xvnlp5lqx98th9zvpptu7uj7zy'},{'key':'validator','value':'bandvaloper12dzdxtd2mtnc37nfutwmj0lv8lsfgn6um0e5q5'},{'key':'validator','value':'bandvaloper1h52l9shahsdzrduwtjt9exc349sehx4s2zydrv'},{'key':'validator','value':'bandvaloper1u3c40nglllu4upuddlz6l59afq7uuz7lq6z977'},{'key':'validator','value':'bandvaloper1g4tfgzuxtnfzpnc7drk83n6r6ghkmzwsc7eglq'},{'key':'validator','value':'bandvaloper1kfj48adjsnrgu83lau6wc646q2uf65rf84tzus'},{'key':'validator','value':'bandvaloper1t0x8dv4frjnrnl0geegf9l5hrj9wa7qwmjrrwg'}]}]}]", - logs=[ - AbciMessageLog( - events=[ - StringEvent(type="message", attributes=[Attribute(key="action", value="request")]), - StringEvent( - type="raw_request", - attributes=[ - Attribute(key="data_source_id", value="61"), - Attribute( - key="data_source_hash", - value="07be7bd61667327aae10b7a13a542c7dfba31b8f4c52b0b60bf9c7b11b1a72ef", - ), - Attribute(key="external_id", value="6"), - Attribute(key="calldata", value="ETH"), - Attribute(key="data_source_id", value="57"), - Attribute( - key="data_source_hash", - value="61b369daa5c0918020a52165f6c7662d5b9c1eee915025cb3d2b9947a26e48c7", - ), - Attribute(key="external_id", value="0"), - Attribute(key="calldata", value="ETH"), - Attribute(key="data_source_id", value="62"), - Attribute( - key="data_source_hash", - value="107048da9dbf7960c79fb20e0585e080bb9be07d42a1ce09c5479bbada8d0289", - ), - Attribute(key="external_id", value="3"), - Attribute(key="calldata", value="ETH"), - Attribute(key="data_source_id", value="60"), - Attribute( - key="data_source_hash", - value="2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac", - ), - Attribute(key="external_id", value="5"), - Attribute(key="calldata", value="huobipro ETH"), - Attribute(key="data_source_id", value="59"), - Attribute( - key="data_source_hash", - value="5c011454981c473af3bf6ef93c76b36bfb6cc0ce5310a70a1ba569de3fc0c15d", - ), - Attribute(key="external_id", value="2"), - Attribute(key="calldata", value="ETH"), - Attribute(key="data_source_id", value="60"), - Attribute( - key="data_source_hash", - value="2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac", - ), - Attribute(key="external_id", value="4"), - Attribute(key="calldata", value="binance ETH"), - Attribute(key="data_source_id", value="60"), - Attribute( - key="data_source_hash", - value="2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac", - ), - Attribute(key="external_id", value="9"), - Attribute(key="calldata", value="bittrex ETH"), - Attribute(key="data_source_id", value="60"), - Attribute( - key="data_source_hash", - value="2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac", - ), - Attribute(key="external_id", value="7"), - Attribute(key="calldata", value="kraken ETH"), - Attribute(key="data_source_id", value="60"), - Attribute( - key="data_source_hash", - value="2e588de76a58338125022bc42b460072300aebbcc4acaf55f91755c1c1799bac", - ), - Attribute(key="external_id", value="8"), - Attribute(key="calldata", value="bitfinex ETH"), - Attribute(key="data_source_id", value="58"), - Attribute( - key="data_source_hash", - value="7e6759fade717a06fb643392bfde837bfc3437da2ded54feed706e6cd35de461", - ), - Attribute(key="external_id", value="1"), - Attribute(key="calldata", value="ETH"), - ], - ), - StringEvent( - type="request", - attributes=[ - Attribute(key="id", value="287004"), - Attribute(key="client_id", value="Blue"), - Attribute(key="oracle_script_id", value="37"), - Attribute(key="calldata", value="00000001000000034554480000000000000064"), - Attribute(key="ask_count", value="16"), - Attribute(key="min_count", value="10"), - Attribute(key="gas_used", value="71512"), - Attribute(key="validator", value="bandvaloper18tjynh8v0kvf9lmjenx02fgltxk0c6jmm2wcjc"), - Attribute(key="validator", value="bandvaloper1w46umthap3cmvqarrznauy25mdhqu45tv8hq62"), - Attribute(key="validator", value="bandvaloper1qudzmeu5yr7ryaq9spfpurptvlv4mxehe8x86e"), - Attribute(key="validator", value="bandvaloper1nlepx7xg53fsy6vslrss6adtmtl8a33kusv7fa"), - Attribute(key="validator", value="bandvaloper1npezmz5cw208gm7l7nhay5xm6h5k4we5axn663"), - Attribute(key="validator", value="bandvaloper1d0kcwzukkjl2w2nty3xerqpy3ypdrph67hxx4v"), - Attribute(key="validator", value="bandvaloper19j74weeme5ehvmfnduz5swkxysz4twg92swxaf"), - Attribute(key="validator", value="bandvaloper1ejnk6k8ny3y5kwr234m3y32p7dxsx2a0wvcpyl"), - Attribute(key="validator", value="bandvaloper185sr49ntmfzfc5z52eh0z5m2vjvahwqa6qvk27"), - Attribute(key="validator", value="bandvaloper106e65xpz88s5xvnlp5lqx98th9zvpptu7uj7zy"), - Attribute(key="validator", value="bandvaloper12dzdxtd2mtnc37nfutwmj0lv8lsfgn6um0e5q5"), - Attribute(key="validator", value="bandvaloper1h52l9shahsdzrduwtjt9exc349sehx4s2zydrv"), - Attribute(key="validator", value="bandvaloper1u3c40nglllu4upuddlz6l59afq7uuz7lq6z977"), - Attribute(key="validator", value="bandvaloper1g4tfgzuxtnfzpnc7drk83n6r6ghkmzwsc7eglq"), - Attribute(key="validator", value="bandvaloper1kfj48adjsnrgu83lau6wc646q2uf65rf84tzus"), - Attribute(key="validator", value="bandvaloper1t0x8dv4frjnrnl0geegf9l5hrj9wa7qwmjrrwg"), - ], - ), - ] - ) - ], - gas_wanted=2000000, - gas_used=789441, - ) -) diff --git a/tests/cosmos_app_test.py b/tests/cosmos_app_test.py index 327af34..b698489 100644 --- a/tests/cosmos_app_test.py +++ b/tests/cosmos_app_test.py @@ -16,7 +16,7 @@ from pyband import PrivateKey from pyband.cosmos_app import CosmosApp, CommException from pyband.exceptions import * -from pyband.messages.oracle.v1 import MsgCreateDataSource +from pyband.messages.band.oracle.v1 import MsgCreateDataSource from pyband.proto.cosmos.base.v1beta1 import Coin from pyband.transaction import Transaction from pyband.utils import bip44_to_list @@ -82,15 +82,22 @@ def _ins_get_addr_secp256k1(self, p1: int, data: bytes): seed = Mnemonic("english").to_seed(self.mnemonic) signing_key = SigningKey.from_string( - BIP32.from_seed(seed).get_privkey_from_path(self.__path_from_data(bip32_byte, 3)), + BIP32.from_seed(seed).get_privkey_from_path( + self.__path_from_data(bip32_byte, 3) + ), curve=SECP256k1, hashfunc=hashlib.sha256, ) verifying_key = signing_key.get_verifying_key() - addr = hashlib.new("ripemd160", hashlib.new("sha256", verifying_key.to_string("compressed")).digest()).digest() + addr = hashlib.new( + "ripemd160", + hashlib.new("sha256", verifying_key.to_string("compressed")).digest(), + ).digest() five_bit_r = convertbits(addr, 8, 5) - return verifying_key.to_string("compressed") + bytes(bech32_encode("band", five_bit_r), "utf-8") + return verifying_key.to_string("compressed") + bytes( + bech32_encode("band", five_bit_r), "utf-8" + ) def _sign_secp256k1(self, p1: int, data: bytes): if p1 == 0: @@ -103,9 +110,9 @@ def _sign_secp256k1(self, p1: int, data: bytes): self.packet_cache.append(data) signing_key = SigningKey.from_string( - BIP32.from_seed(Mnemonic("english").to_seed(self.mnemonic)).get_privkey_from_path( - self.__path_from_data(self.packet_cache[0], 3) - ), + BIP32.from_seed( + Mnemonic("english").to_seed(self.mnemonic) + ).get_privkey_from_path(self.__path_from_data(self.packet_cache[0], 3)), curve=SECP256k1, hashfunc=hashlib.sha256, ) @@ -151,7 +158,9 @@ def mock_message(): deploy_msg = MsgCreateDataSource( name="Hello World!", description="", - executable=bytes("".join(random.choice(string.ascii_letters) for i in range(200)), "utf-8"), + executable=bytes( + "".join(random.choice(string.ascii_letters) for i in range(200)), "utf-8" + ), fee=[Coin(amount="0", denom="uband")], treasury="band000000000000000000000000000000000000000", owner="band000000000000000000000000000000000000000", diff --git a/tests/transaction_test.py b/tests/transaction_test.py index b683fc7..70b7df7 100644 --- a/tests/transaction_test.py +++ b/tests/transaction_test.py @@ -7,8 +7,12 @@ from pyband import Client from pyband.exceptions import EmptyMsgError, UndefinedError, ValueTooLargeError -from pyband.messages.oracle.v1 import MsgRequestData -from pyband.proto.cosmos.auth.v1beta1 import QueryAccountRequest, QueryAccountResponse +from pyband.messages.band.oracle.v1 import MsgRequestData +from pyband.proto.cosmos.auth.v1beta1 import ( + BaseAccount, + QueryAccountInfoResponse, + QueryAccountInfoRequest, +) from pyband.proto.cosmos.auth.v1beta1 import QueryBase as CosmosAuthServiceBase from pyband.proto.cosmos.base.v1beta1 import Coin from pyband.proto.cosmos.tx.v1beta1 import SignDoc @@ -23,13 +27,17 @@ class AuthService(CosmosAuthServiceBase): - async def account(self, query_accounts_request: QueryAccountRequest): - return QueryAccountResponse( - account=Any( - type_url="/cosmos.auth.v1beta1.BaseAccount", - value=b"\n+band1z2hwz2vn6ardpjzgfx2k3wh2zglknwavhw3v2r\022F\n\037/cosmos.crypto.secp256k1.PubKey\022#\n!\002\243\357\354\271\2712\330H\300F\342suhP\357^!\007\244&\365\t\314\274\312\034~\240\004A\341\030h \010", - ) + async def account_info(self, query_accounts_request: QueryAccountInfoRequest): + base_account = BaseAccount( + address="band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", + pub_key=Any( + type_url="/cosmos.crypto.secp256k1.PubKey", + value=b"\n\021\003\214\211\255\243\264\216\305\363,\370\332\214C\356\022yM?9\207B?\371\210\002\325\374\366\356C\021\223", + ), + account_number=1, + sequence=0, ) + return QueryAccountInfoResponse(info=base_account) @pytest_asyncio.fixture(scope="module") @@ -64,7 +72,7 @@ def test_get_sign_doc_success(): t = Transaction().with_messages(msg).with_account_num(100).with_sequence(30).with_chain_id("bandchain") assert t.get_sign_doc(PUBLIC_KEY) == SignDoc( - body_bytes=b"\n\x84\x01\n\x19/oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", + body_bytes=b"\n\x89\x01\n\x1e/band.oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", auth_info_bytes=b"\nP\nF\n\x1f/cosmos.crypto.secp256k1.PubKey\x12#\n!\x03\xfep\x8b\xdafRO\xd2\xc6\xbc\xe9\x06\x82\xe3\x85U\xa8Q\xe0=*\xeeOb\x9b\x05\xde\x90\xf5\x1e\xd9\xbc\x12\x04\n\x02\x08\x01\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10\xc0\x9a\x0c", chain_id="bandchain", account_number=100, @@ -86,7 +94,7 @@ def test_get_sign_doc_no_public_key_success(): t = Transaction().with_messages(msg).with_account_num(100).with_sequence(30).with_chain_id("bandchain") assert t.get_sign_doc() == SignDoc( - body_bytes=b"\n\x84\x01\n\x19/oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", + body_bytes=b"\n\x89\x01\n\x1E/band.oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", auth_info_bytes=b"\n\x08\x12\x04\n\x02\x08\x01\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10\xc0\x9a\x0c", chain_id="bandchain", account_number=100, @@ -106,22 +114,24 @@ async def test_get_sign_data_with_sender_success(pyband_client): execute_gas=50000, sender="band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", ) - fee = [Coin(amount="0", denom="uband")] t = Transaction().with_messages(msg).with_chain_id("bandchain").with_gas_limit(50000) await t.with_sender(pyband_client, "band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c") assert t.get_sign_doc(PUBLIC_KEY) == SignDoc( - body_bytes=b"\n\x84\x01\n\x19/oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", - auth_info_bytes=b"\nP\nF\n\x1f/cosmos.crypto.secp256k1.PubKey\x12#\n!\x03\xfep\x8b\xdafRO\xd2\xc6\xbc\xe9\x06\x82\xe3\x85U\xa8Q\xe0=*\xeeOb\x9b\x05\xde\x90\xf5\x1e\xd9\xbc\x12\x04\n\x02\x08\x01\x18\x08\x12\x12\n\x0c\n\x05uband\x12\x03125\x10\xd0\x86\x03", + body_bytes=b"\n\x89\x01\n\x1e/band.oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c", + auth_info_bytes=b"\nN\nF\n\x1f/cosmos.crypto.secp256k1.PubKey\x12#\n!\x03\xfep\x8b\xdafRO\xd2\xc6\xbc\xe9\x06\x82\xe3\x85U\xa8Q\xe0=*\xeeOb\x9b\x05\xde\x90\xf5\x1e\xd9\xbc\x12\x04\n\x02\x08\x01\x12\x12\n\x0c\n\x05uband\x12\x03125\x10\xd0\x86\x03", chain_id="bandchain", - account_number=104, + account_number=1, ) @pytest.mark.asyncio async def test_create_transaction_with_sender_fail(pyband_client): - with pytest.raises(EmptyMsgError, match="message is empty, please use with_messages at least 1 message"): + with pytest.raises( + EmptyMsgError, + match="message is empty, please use with_messages at least 1 message", + ): await Transaction().with_sender(pyband_client, "band13eznuehmqzd3r84fkxu8wklxl22r2qfmtlth8c") @@ -225,16 +235,16 @@ def test_get_tx_data_success(): signature = PRIVATE_KEY.sign(sign_doc.SerializeToString()) tx_raw_bytes = t.get_tx_data(signature, PUBLIC_KEY) assert tx_raw_bytes == ( - b"\n\x87\x01\n\x84\x01\n\x19/oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00" - b"\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyb" - b"and2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band1jrhuqrymzt4m" - b"nvgw8cvy3s9zhx3jj0dq30qpte\x12f\nP\nF\n\x1f/cosmos.crypto.secp256k1.PubKe" - b"y\x12#\n!\x03\xfep\x8b\xdafRO\xd2\xc6\xbc\xe9\x06\x82\xe3\x85U\xa8Q" - b"\xe0=*\xeeOb\x9b\x05\xde\x90\xf5\x1e\xd9\xbc\x12\x04\n\x02\x08\x01" - b"\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10\xc0\x9a\x0c\x1a@\xfbPZh" - b"\xc4\x8al9\t\x99\xbdq\xbd5R\x0c\xc0\x91\xff7\x03\x8f\xde\x81\xe6\x96\x84\x8f" - b"I03&f|#\x91\xbaK\x01\x9c\x94\x04r\x94wg\xcfc\x0cQ\x03\xffp>\x1a]" - b"\xcb\xd0\x08\x7fo \x90\x82" + b"\n\x8c\x01\n\x89\x01\n\x1e/band.oracle.v1.MsgRequestData\x12g" + b"\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18" + b"\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0" + b"\x86\x03J+band1jrhuqrymzt4mnvgw8cvy3s9zhx3jj0dq30qpte\x12f\nP\nF\n\x1f/cosm" + b"os.crypto.secp256k1.PubKey\x12#\n!\x03\xfep\x8b\xdafRO\xd2\xc6" + b"\xbc\xe9\x06\x82\xe3\x85U\xa8Q\xe0=*\xeeOb\x9b\x05\xde\x90\xf5" + b"\x1e\xd9\xbc\x12\x04\n\x02\x08\x01\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03" + b"500\x10\xc0\x9a\x0c\x1a@u\x1e\x9e\x10\x0c\xd9gL\x0f\xabp\xfa\xc7\xef=\xc0pme" + b"\xa9\xb3C1C\xd7iv\x85\xf2\x7f\xf1tLs\xff\xf0\xdf\xf1\x9b\x9as\x00\xd3" + b"\x00k2\x00\x07>\xc3r\xed\x1d\xefb\xe4G\xe2\x17>Ek\xcf#" ) @@ -257,14 +267,14 @@ def test_get_tx_data_tx_raw_bytes_no_public_key_success(): signature = PRIVATE_KEY.sign(sign_doc.SerializeToString()) tx_raw_bytes = t.get_tx_data(signature) assert tx_raw_bytes == ( - b"\n\x87\x01\n\x84\x01\n\x19/oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00" - b"\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyb" - b"and2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band1jrhuqrymzt4m" - b"nvgw8cvy3s9zhx3jj0dq30qpte\x12\x1e\n\x08\x12\x04\n\x02\x08\x01" - b"\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10\xc0\x9a\x0c\x1a@\xfbPZh" - b"\xc4\x8al9\t\x99\xbdq\xbd5R\x0c\xc0\x91\xff7\x03\x8f\xde\x81\xe6\x96\x84\x8f" - b"I03&f|#\x91\xbaK\x01\x9c\x94\x04r\x94wg\xcfc\x0cQ\x03\xffp>\x1a]" - b"\xcb\xd0\x08\x7fo \x90\x82" + b"\n\x8c\x01\n\x89\x01\n\x1e/band.oracle.v1.MsgRequestData\x12g" + b"\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18" + b"\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0" + b"\x86\x03J+band1jrhuqrymzt4mnvgw8cvy3s9zhx3jj0dq30qpte\x12\x1e\n\x08\x12" + b"\x04\n\x02\x08\x01\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10" + b"\xc0\x9a\x0c\x1a@u\x1e\x9e\x10\x0c\xd9gL\x0f\xabp\xfa\xc7\xef=\xc0pme" + b"\xa9\xb3C1C\xd7iv\x85\xf2\x7f\xf1tLs\xff\xf0\xdf\xf1\x9b\x9as\x00\xd3" + b"\x00k2\x00\x07>\xc3r\xed\x1d\xefb\xe4G\xe2\x17>Ek\xcf#" ) @@ -287,12 +297,12 @@ def test_get_tx_data_no_public_key_success(): signature = PRIVATE_KEY.sign(sign_doc.SerializeToString()) tx_raw_bytes = t.get_tx_data(signature) assert tx_raw_bytes == ( - b"\n\x87\x01\n\x84\x01\n\x19/oracle.v1.MsgRequestData\x12g\x08\x01\x12\x0f\x00" - b"\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18\x04 \x03*\x0bfrom_pyb" - b"and2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0\x86\x03J+band1jrhuqrymzt4m" - b"nvgw8cvy3s9zhx3jj0dq30qpte\x12\x1e\n\x08\x12\x04\n\x02\x08\x01" - b"\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10\xc0\x9a\x0c\x1a@" - b"\xd3\x84\xa1\xbc\xdb\x07\xbe\xd5\xf5\xa3\x95w.\xe1\xa3\xab0t\xc4\xcb" - b"\xb5\xb7\xeb1\x86\xc8>=\xf4&\x99CmdU\x1f\xe8\x18\x11<\x9a\xfd\xf4\xf8" - b"\x18\x8f>\xba\x8dzZ\xdfq\xe8\x88i\x92c3\xab_\x90\xc6\x8d" + b"\n\x8c\x01\n\x89\x01\n\x1e/band.oracle.v1.MsgRequestData\x12g" + b"\x08\x01\x12\x0f\x00\x00\x00\x03BTC\x00\x00\x00\x00\x00\x00\x00\x01\x18" + b"\x04 \x03*\x0bfrom_pyband2\x0c\n\x05uband\x12\x031008\xb0\xea\x01@\xd0" + b"\x86\x03J+band1jrhuqrymzt4mnvgw8cvy3s9zhx3jj0dq30qpte\x12\x1e\n\x08\x12" + b"\x04\n\x02\x08\x01\x18\x1e\x12\x12\n\x0c\n\x05uband\x12\x03500\x10" + b"\xc0\x9a\x0c\x1a@\x82wIf\x05r\xd7\xcd\x8ei`\xf4x>$w\x1a6\xd5;\xb9-NrD\x048" + b"$z\x92D\xc4\x19\xf5<\x9e\xd5\x94\x88w.o\xf23\xe8\xfc\xf6\x12\xe7~\xe7" + b"\x9cm\xcb\xbbh\x1f*\xbb\xaa\xdd\x02\xff\xa0" )